[Python-checkins] CVS: python/dist/src/Objects longobject.c,1.104,1.105

Tim Peters tim_one@users.sourceforge.net
Tue, 11 Sep 2001 15:31:36 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv600/python/Objects

Modified Files:
	longobject.c 
Log Message:
More bug 460020.  Disable a number of long optimizations for long subclasses.


Index: longobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v
retrieving revision 1.104
retrieving revision 1.105
diff -C2 -d -r1.104 -r1.105
*** longobject.c	2001/09/10 20:52:51	1.104
--- longobject.c	2001/09/11 22:31:33	1.105
***************
*** 1298,1302 ****
  	int i;
  	digit carry = 0;
! 	
  	/* Ensure a is the larger of the two: */
  	if (size_a < size_b) {
--- 1298,1302 ----
  	int i;
  	digit carry = 0;
! 
  	/* Ensure a is the larger of the two: */
  	if (size_a < size_b) {
***************
*** 1333,1337 ****
  	int sign = 1;
  	digit borrow = 0;
! 	
  	/* Ensure a is the larger of the two: */
  	if (size_a < size_b) {
--- 1333,1337 ----
  	int sign = 1;
  	digit borrow = 0;
! 
  	/* Ensure a is the larger of the two: */
  	if (size_a < size_b) {
***************
*** 1382,1386 ****
  {
  	PyLongObject *a, *b, *z;
! 	
  	CONVERT_BINOP((PyObject *)v, (PyObject *)w, &a, &b);
  
--- 1382,1386 ----
  {
  	PyLongObject *a, *b, *z;
! 
  	CONVERT_BINOP((PyObject *)v, (PyObject *)w, &a, &b);
  
***************
*** 1821,1826 ****
  long_pos(PyLongObject *v)
  {
! 	Py_INCREF(v);
! 	return (PyObject *)v;
  }
  
--- 1821,1830 ----
  long_pos(PyLongObject *v)
  {
! 	if (PyLong_CheckExact(v)) {
! 		Py_INCREF(v);
! 		return (PyObject *)v;
! 	}
! 	else
! 		return _PyLong_Copy(v);
  }
  
***************
*** 1829,1845 ****
  {
  	PyLongObject *z;
! 	int i, n;
! 	n = ABS(v->ob_size);
! 	if (n == 0) {
  		/* -0 == 0 */
  		Py_INCREF(v);
  		return (PyObject *) v;
  	}
! 	z = _PyLong_New(ABS(n));
! 	if (z == NULL)
! 		return NULL;
! 	for (i = 0; i < n; i++)
! 		z->ob_digit[i] = v->ob_digit[i];
! 	z->ob_size = -(v->ob_size);
  	return (PyObject *)z;
  }
--- 1833,1844 ----
  {
  	PyLongObject *z;
! 	if (v->ob_size == 0 && PyLong_CheckExact(v)) {
  		/* -0 == 0 */
  		Py_INCREF(v);
  		return (PyObject *) v;
  	}
! 	z = (PyLongObject *)_PyLong_Copy(v);
! 	if (z != NULL)
! 		z->ob_size = -(v->ob_size);
  	return (PyObject *)z;
  }
***************
*** 1850,1857 ****
  	if (v->ob_size < 0)
  		return long_neg(v);
! 	else {
! 		Py_INCREF(v);
! 		return (PyObject *)v;
! 	}
  }
  
--- 1849,1854 ----
  	if (v->ob_size < 0)
  		return long_neg(v);
! 	else
! 		return long_pos(v);
  }