[Python-checkins] python/dist/src/Objects listobject.c,2.208,2.209

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Thu Jul 29 04:29:28 CEST 2004


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13944/Objects
Modified Files:
	listobject.c 
Log Message:
Trimmed trailing whitespace.
Index: listobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v
retrieving revision 2.208
retrieving revision 2.209
diff -C2 -d -r2.208 -r2.209
*** listobject.c	29 Jul 2004 02:28:42 -0000	2.208
--- listobject.c	29 Jul 2004 02:29:26 -0000	2.209
***************
*** 160,164 ****
 		return -1;
 	}
! 	
 	if (list_resize(self, n+1) == -1)
 		return -1;
--- 160,164 ----
 		return -1;
 	}
! 
 	if (list_resize(self, n+1) == -1)
 		return -1;
***************
*** 239,244 ****
 	if (num_free_lists < MAXFREELISTS && PyList_CheckExact(op))
 		free_lists[num_free_lists++] = op;
! 	else 
! 		op->ob_type->tp_free((PyObject *)op);		
 	Py_TRASHCAN_SAFE_END(op)
 }
--- 239,244 ----
 	if (num_free_lists < MAXFREELISTS && PyList_CheckExact(op))
 		free_lists[num_free_lists++] = op;
! 	else
! 		op->ob_type->tp_free((PyObject *)op);
 	Py_TRASHCAN_SAFE_END(op)
 }
***************
*** 546,550 ****
 		p += ihigh - ilow;
 		if (d < 0) {
! 			memmove(&item[ihigh+d], &item[ihigh], 
 				(a->ob_size - ihigh)*sizeof(PyObject *));
 			list_resize(a, a->ob_size + d);
--- 546,550 ----
 		p += ihigh - ilow;
 		if (d < 0) {
! 			memmove(&item[ihigh+d], &item[ihigh],
 				(a->ob_size - ihigh)*sizeof(PyObject *));
 			list_resize(a, a->ob_size + d);
***************
*** 618,622 ****
 	}
 
! 	if (list_resize(self, size*n) == -1) 
 		return NULL;
 
--- 618,622 ----
 	}
 
! 	if (list_resize(self, size*n) == -1)
 		return NULL;
 
***************
*** 683,688 ****
 
 	/* Special cases:
! 	 1) lists and tuples which can use PySequence_Fast ops 
! 	 2) extending self to self requires making a copy first 
 	*/
 	if (PyList_CheckExact(b) || PyTuple_CheckExact(b) || (PyObject *)self == b) {
--- 683,688 ----
 
 	/* Special cases:
! 	 1) lists and tuples which can use PySequence_Fast ops
! 	 2) extending self to self requires making a copy first
 	*/
 	if (PyList_CheckExact(b) || PyTuple_CheckExact(b) || (PyObject *)self == b) {
***************
*** 1722,1728 ****
 /* Special wrapper to support stable sorting using the decorate-sort-undecorate
 pattern. Holds a key which is used for comparisions and the original record
! which is returned during the undecorate phase. By exposing only the key 
! during comparisons, the underlying sort stability characteristics are left 
! unchanged. Also, if a custom comparison function is used, it will only see 
 the key instead of a full record. */
 
--- 1722,1728 ----
 /* Special wrapper to support stable sorting using the decorate-sort-undecorate
 pattern. Holds a key which is used for comparisions and the original record
! which is returned during the undecorate phase. By exposing only the key
! during comparisons, the underlying sort stability characteristics are left
! unchanged. Also, if a custom comparison function is used, it will only see
 the key instead of a full record. */
 
***************
*** 1739,1743 ****
 {
 	if (!PyObject_TypeCheck(b, &sortwrapper_type)) {
! 		PyErr_SetString(PyExc_TypeError, 
 			"expected a sortwrapperobject");
 		return NULL;
--- 1739,1743 ----
 {
 	if (!PyObject_TypeCheck(b, &sortwrapper_type)) {
! 		PyErr_SetString(PyExc_TypeError,
 			"expected a sortwrapperobject");
 		return NULL;
***************
*** 1778,1782 ****
 	0,					/* tp_setattro */
 	0,					/* tp_as_buffer */
! 	Py_TPFLAGS_DEFAULT | 
 	Py_TPFLAGS_HAVE_RICHCOMPARE, 		/* tp_flags */
 	sortwrapper_doc,			/* tp_doc */
--- 1778,1782 ----
 	0,					/* tp_setattro */
 	0,					/* tp_as_buffer */
! 	Py_TPFLAGS_DEFAULT |
 	Py_TPFLAGS_HAVE_RICHCOMPARE, 		/* tp_flags */
 	sortwrapper_doc,			/* tp_doc */
***************
*** 1793,1797 ****
 {
 	sortwrapperobject *so;
! 	
 	so = PyObject_New(sortwrapperobject, &sortwrapper_type);
 	if (so == NULL)
--- 1793,1797 ----
 {
 	sortwrapperobject *so;
! 
 	so = PyObject_New(sortwrapperobject, &sortwrapper_type);
 	if (so == NULL)
***************
*** 1809,1813 ****
 
 	if (!PyObject_TypeCheck(so, &sortwrapper_type)) {
! 		PyErr_SetString(PyExc_TypeError, 
 			"expected a sortwrapperobject");
 		return NULL;
--- 1809,1813 ----
 
 	if (!PyObject_TypeCheck(so, &sortwrapper_type)) {
! 		PyErr_SetString(PyExc_TypeError,
 			"expected a sortwrapperobject");
 		return NULL;
***************
*** 1843,1847 ****
 	if (!PyObject_TypeCheck(x, &sortwrapper_type) ||
 	 !PyObject_TypeCheck(y, &sortwrapper_type)) {
! 		PyErr_SetString(PyExc_TypeError, 
 			"expected a sortwrapperobject");
 		return NULL;
--- 1843,1847 ----
 	if (!PyObject_TypeCheck(x, &sortwrapper_type) ||
 	 !PyObject_TypeCheck(y, &sortwrapper_type)) {
! 		PyErr_SetString(PyExc_TypeError,
 			"expected a sortwrapperobject");
 		return NULL;
***************
*** 1884,1888 ****
 {
 	cmpwrapperobject *co;
! 	
 	co = PyObject_New(cmpwrapperobject, &cmpwrapper_type);
 	if (co == NULL)
--- 1884,1888 ----
 {
 	cmpwrapperobject *co;
! 
 	co = PyObject_New(cmpwrapperobject, &cmpwrapper_type);
 	if (co == NULL)
***************
*** 1949,1953 ****
 		for (i=0 ; i < saved_ob_size ; i++) {
 			value = saved_ob_item[i];
! 			key = PyObject_CallFunctionObjArgs(keyfunc, value, 
 							 NULL);
 			if (key == NULL) {
--- 1949,1953 ----
 		for (i=0 ; i < saved_ob_size ; i++) {
 			value = saved_ob_item[i];
! 			key = PyObject_CallFunctionObjArgs(keyfunc, value,
 							 NULL);
 			if (key == NULL) {
***************
*** 1958,1962 ****
 					Py_DECREF(kvpair);
 				}
! 				if (self->ob_item != empty_ob_item 
 				 || self->ob_size) {
 					/* If the list changed *as well* we
--- 1958,1962 ----
 					Py_DECREF(kvpair);
 				}
! 				if (self->ob_item != empty_ob_item
 				 || self->ob_size) {
 					/* If the list changed *as well* we
***************
*** 1969,1973 ****
 						(PyObject *)NULL);
 				}
! 				
 				goto dsu_fail;
 			}
--- 1969,1973 ----
 						(PyObject *)NULL);
 				}
! 
 				goto dsu_fail;
 			}
***************
*** 2503,2507 ****
 				}
 
! 				memmove(self->ob_item + cur - i, 
 					self->ob_item + cur + 1,
 					lim * sizeof(PyObject *));
--- 2503,2507 ----
 				}
 
! 				memmove(self->ob_item + cur - i,
 					self->ob_item + cur + 1,
 					lim * sizeof(PyObject *));
***************
*** 2535,2539 ****
 			}
 			else {
! 				seq = PySequence_Fast(value, 
 					"must assign iterable to extended slice");
 				if (!seq)
--- 2535,2539 ----
 			}
 			else {
! 				seq = PySequence_Fast(value,
 					"must assign iterable to extended slice");
 				if (!seq)


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /