[Python-checkins] python/dist/src/Objects listobject.c,2.176,2.177

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Sun Jan 18 15:31:04 EST 2004


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

Modified Files:
	listobject.c 
Log Message:
Revert change accidentally checked in as part of a whitespace normalization
patch.


Index: listobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v
retrieving revision 2.176
retrieving revision 2.177
diff -C2 -d -r2.176 -r2.177
*** listobject.c	18 Jan 2004 20:29:55 -0000	2.176
--- listobject.c	18 Jan 2004 20:31:02 -0000	2.177
***************
*** 58,70 ****
  	PyListObject *op;
  	size_t nbytes;
- 	int allocated_size = roundupsize(size);
- 
  	if (size < 0) {
  		PyErr_BadInternalCall();
  		return NULL;
  	}
! 	nbytes = allocated_size * sizeof(PyObject *);
  	/* Check for overflow */
! 	if (nbytes / sizeof(PyObject *) != (size_t)allocated_size) {
  		return PyErr_NoMemory();
  	}
--- 58,68 ----
  	PyListObject *op;
  	size_t nbytes;
  	if (size < 0) {
  		PyErr_BadInternalCall();
  		return NULL;
  	}
! 	nbytes = size * sizeof(PyObject *);
  	/* Check for overflow */
! 	if (nbytes / sizeof(PyObject *) != (size_t)size) {
  		return PyErr_NoMemory();
  	}
***************
*** 81,85 ****
  			return PyErr_NoMemory();
  		}
! 		memset(op->ob_item, 0, sizeof(*op->ob_item) * allocated_size);
  	}
  	op->ob_size = size;
--- 79,83 ----
  			return PyErr_NoMemory();
  		}
! 		memset(op->ob_item, 0, sizeof(*op->ob_item) * size);
  	}
  	op->ob_size = size;
***************
*** 157,162 ****
  	}
  	items = self->ob_item;
! 	if (roundupsize(self->ob_size) - 1 == self->ob_size || items == NULL)
! 		NRESIZE(items, PyObject *, self->ob_size+1);
  	if (items == NULL) {
  		PyErr_NoMemory();
--- 155,159 ----
  	}
  	items = self->ob_item;
! 	NRESIZE(items, PyObject *, self->ob_size+1);
  	if (items == NULL) {
  		PyErr_NoMemory();
***************
*** 1882,1887 ****
  	saved_ob_item = self->ob_item;
  	self->ob_size = 0;
! /*	self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, 0); */
! 	self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, roundupsize(0));
  
  	if (keyfunc != NULL) {
--- 1879,1883 ----
  	saved_ob_item = self->ob_item;
  	self->ob_size = 0;
! 	self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, 0);
  
  	if (keyfunc != NULL) {





More information about the Python-checkins mailing list