[Python-checkins] python/dist/src/Objects abstract.c,2.98,2.99

gvanrossum@sourceforge.net gvanrossum@sourceforge.net
2002年4月16日 09:32:53 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv23788
Modified Files:
	abstract.c 
Log Message:
Whitespace normalization and fold some long lines.
Index: abstract.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v
retrieving revision 2.98
retrieving revision 2.99
diff -C2 -d -r2.98 -r2.99
*** abstract.c	8 Mar 2002 21:28:54 -0000	2.98
--- abstract.c	16 Apr 2002 16:32:50 -0000	2.99
***************
*** 404,408 ****
 	return Py_NotImplemented;
 }
! 	 
 static PyObject *
 binary_op(PyObject *v, PyObject *w, const int op_slot, const char *op_name)
--- 404,408 ----
 	return Py_NotImplemented;
 }
! 
 static PyObject *
 binary_op(PyObject *v, PyObject *w, const int op_slot, const char *op_name)
***************
*** 412,416 ****
 		Py_DECREF(Py_NotImplemented);
 		PyErr_Format(
! 			PyExc_TypeError, 
 			"unsupported operand type(s) for %s: '%s' and '%s'",
 			op_name,
--- 412,416 ----
 		Py_DECREF(Py_NotImplemented);
 		PyErr_Format(
! 			PyExc_TypeError,
 			"unsupported operand type(s) for %s: '%s' and '%s'",
 			op_name,
***************
*** 463,467 ****
 	ternaryfunc slotw = NULL;
 	ternaryfunc slotz = NULL;
! 	
 	mv = v->ob_type->tp_as_number;
 	mw = w->ob_type->tp_as_number;
--- 463,467 ----
 	ternaryfunc slotw = NULL;
 	ternaryfunc slotz = NULL;
! 
 	mv = v->ob_type->tp_as_number;
 	mw = w->ob_type->tp_as_number;
***************
*** 511,515 ****
 		PyObject *v1, *z1, *w2, *z2;
 		int c;
! 		
 		c = PyNumber_Coerce(&v, &w);
 		if (c != 0)
--- 511,515 ----
 		PyObject *v1, *z1, *w2, *z2;
 		int c;
! 
 		c = PyNumber_Coerce(&v, &w);
 		if (c != 0)
***************
*** 665,669 ****
 is the one the operation is performed on, and it's up to the
 function to deal with the right-hand object.
! 
 - Otherwise, in-place modification is not supported. Handle it exactly as
 a non in-place operation of the same kind.
--- 665,669 ----
 is the one the operation is performed on, and it's up to the
 function to deal with the right-hand object.
! 
 - Otherwise, in-place modification is not supported. Handle it exactly as
 a non in-place operation of the same kind.
***************
*** 671,675 ****
 */
 
! #define HASINPLACE(t) PyType_HasFeature((t)->ob_type, Py_TPFLAGS_HAVE_INPLACEOPS)
 
 static PyObject *
--- 671,676 ----
 */
 
! #define HASINPLACE(t) \
! 	PyType_HasFeature((t)->ob_type, Py_TPFLAGS_HAVE_INPLACEOPS)
 
 static PyObject *
***************
*** 734,738 ****
 			return (*f)(v, w);
 	}
! 	return binary_iop(v, w, NB_SLOT(nb_inplace_add), NB_SLOT(nb_add), "+=");
 }
 
--- 735,740 ----
 			return (*f)(v, w);
 	}
! 	return binary_iop(v, w, NB_SLOT(nb_inplace_add),
! 			 NB_SLOT(nb_add), "+=");
 }
 
***************
*** 753,757 ****
 		}
 		else {
! 			return type_error("can't multiply sequence to non-int");
 		}
 		return (*g)(v, (int)n);
--- 755,760 ----
 		}
 		else {
! 			return type_error(
! 				"can't multiply sequence to non-int");
 		}
 		return (*g)(v, (int)n);
***************
*** 761,766 ****
 }
 
- 
- 
 PyObject *
 PyNumber_InPlaceRemainder(PyObject *v, PyObject *w)
--- 764,767 ----
***************
*** 777,781 ****
 }
 
- 
 PyObject *
 PyNumber_InPlacePower(PyObject *v, PyObject *w, PyObject *z)
--- 778,781 ----
***************
*** 886,890 ****
 	}
 	if (PyString_Check(o))
! 		return int_from_string(PyString_AS_STRING(o), 
 				 PyString_GET_SIZE(o));
 #ifdef Py_USING_UNICODE
--- 886,890 ----
 	}
 	if (PyString_Check(o))
! 		return int_from_string(PyString_AS_STRING(o),
 				 PyString_GET_SIZE(o));
 #ifdef Py_USING_UNICODE
***************
*** 938,942 ****
 		return _PyLong_Copy((PyLongObject *)o);
 	if (PyString_Check(o))
! 		/* need to do extra error checking that PyLong_FromString() 
 		 * doesn't do. In particular long('9.5') must raise an
 		 * exception, not truncate the float.
--- 938,942 ----
 		return _PyLong_Copy((PyLongObject *)o);
 	if (PyString_Check(o))
! 		/* need to do extra error checking that PyLong_FromString()
 		 * doesn't do. In particular long('9.5') must raise an
 		 * exception, not truncate the float.
***************
*** 1939,1946 ****
 		PyObject *cls_bases = abstract_get_bases(cls);
 		if (cls_bases == NULL) {
! 			PyErr_SetString(PyExc_TypeError, 
 				"isinstance() arg 2 must be a class or type");
 			return -1;
! 		} 
 		Py_DECREF(cls_bases);
 		if (__class__ == NULL) {
--- 1939,1946 ----
 		PyObject *cls_bases = abstract_get_bases(cls);
 		if (cls_bases == NULL) {
! 			PyErr_SetString(PyExc_TypeError,
 				"isinstance() arg 2 must be a class or type");
 			return -1;
! 		}
 		Py_DECREF(cls_bases);
 		if (__class__ == NULL) {
***************
*** 1971,1978 ****
 		PyObject *derived_bases;
 		PyObject *cls_bases;
! 	 
 		derived_bases = abstract_get_bases(derived);
 		if (derived_bases == NULL) {
! 			PyErr_SetString(PyExc_TypeError, 
 					"issubclass() arg 1 must be a class");
 			return -1;
--- 1971,1978 ----
 		PyObject *derived_bases;
 		PyObject *cls_bases;
! 
 		derived_bases = abstract_get_bases(derived);
 		if (derived_bases == NULL) {
! 			PyErr_SetString(PyExc_TypeError,
 					"issubclass() arg 1 must be a class");
 			return -1;
***************
*** 1982,1986 ****
 		cls_bases = abstract_get_bases(cls);
 		if (cls_bases == NULL) {
! 			PyErr_SetString(PyExc_TypeError, 
 					"issubclass() arg 2 must be a class");
 			return -1;
--- 1982,1986 ----
 		cls_bases = abstract_get_bases(cls);
 		if (cls_bases == NULL) {
! 			PyErr_SetString(PyExc_TypeError,
 					"issubclass() arg 2 must be a class");
 			return -1;
***************
*** 2009,2013 ****
 		if (PySequence_Check(o))
 			return PySeqIter_New(o);
! 		PyErr_SetString(PyExc_TypeError, 
 				"iteration over non-sequence");
 		return NULL;
--- 2009,2013 ----
 		if (PySequence_Check(o))
 			return PySeqIter_New(o);
! 		PyErr_SetString(PyExc_TypeError,
 				"iteration over non-sequence");
 		return NULL;
***************
*** 2051,2053 ****
 	return result;
 }
- 
--- 2051,2052 ----

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