[Python-checkins] CVS: python/dist/src/Objects classobject.c,2.81,2.82 complexobject.c,2.21,2.22 floatobject.c,2.53,2.54 frameobject.c,2.36,2.37 intobject.c,2.36,2.37 listobject.c,2.62,2.63 methodobject.c,2.24,2.25 object.c,2.61,2.62 stringobject.c,2.53,2.54 tupleobject.c,2.28,2.29

Guido van Rossum guido@cnri.reston.va.us
Thu, 20 Jan 2000 17:33:28 -0500 (EST)


Update of /projects/cvsroot/python/dist/src/Objects
In directory eric:/tmp/python/dist/src/Objects

Modified Files:
	classobject.c complexobject.c floatobject.c frameobject.c 
	intobject.c listobject.c methodobject.c object.c 
	stringobject.c tupleobject.c 
Log Message:
The rest of the changes by Trent Mick and Dale Nagata for warning-free
compilation on NT Alpha.  Mostly added casts etc.


Index: classobject.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Objects/classobject.c,v
retrieving revision 2.81
retrieving revision 2.82
diff -C2 -r2.81 -r2.82
*** classobject.c	1999/10/11 14:03:12	2.81
--- classobject.c	2000/01/20 22:32:54	2.82
***************
*** 505,509 ****
  	extern long _Py_RefTotal;
  	inst->ob_type = &PyInstance_Type;
! 	_Py_NewReference(inst);
  	_Py_RefTotal--;		/* compensate for increment in NEWREF */
  #ifdef COUNT_ALLOCS
--- 505,509 ----
  	extern long _Py_RefTotal;
  	inst->ob_type = &PyInstance_Type;
! 	_Py_NewReference((PyObject *)inst);
  	_Py_RefTotal--;		/* compensate for increment in NEWREF */
  #ifdef COUNT_ALLOCS
***************
*** 557,561 ****
  	inst->ob_type->tp_free--;	/* compensate for increment in UNREF */
  #endif
! 	_Py_ForgetReference(inst);
  	inst->ob_type = NULL;
  #endif /* Py_TRACE_REFS */
--- 557,561 ----
  	inst->ob_type->tp_free--;	/* compensate for increment in UNREF */
  #endif
! 	_Py_ForgetReference((PyObject *)inst);
  	inst->ob_type = NULL;
  #endif /* Py_TRACE_REFS */
***************
*** 1432,1436 ****
  		free_list = (PyMethodObject *)(im->im_self);
  		im->ob_type = &PyMethod_Type;
! 		_Py_NewReference(im);
  	}
  	else {
--- 1432,1436 ----
  		free_list = (PyMethodObject *)(im->im_self);
  		im->ob_type = &PyMethod_Type;
! 		_Py_NewReference((PyObject *)im);
  	}
  	else {

Index: complexobject.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Objects/complexobject.c,v
retrieving revision 2.21
retrieving revision 2.22
diff -C2 -r2.21 -r2.22
*** complexobject.c	1999/01/25 19:42:19	2.21
--- complexobject.c	2000/01/20 22:32:54	2.22
***************
*** 173,177 ****
  	op->ob_type = &PyComplex_Type;
  	op->cval = cval;
! 	_Py_NewReference(op);
  	return (PyObject *) op;
  }
--- 173,177 ----
  	op->ob_type = &PyComplex_Type;
  	op->cval = cval;
! 	_Py_NewReference((PyObject *)op);
  	return (PyObject *) op;
  }

Index: floatobject.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Objects/floatobject.c,v
retrieving revision 2.53
retrieving revision 2.54
diff -C2 -r2.53 -r2.54
*** floatobject.c	1999/12/23 19:00:28	2.53
--- floatobject.c	2000/01/20 22:32:54	2.54
***************
*** 146,150 ****
  	op->ob_type = &PyFloat_Type;
  	op->ob_fval = fval;
! 	_Py_NewReference(op);
  	return (PyObject *) op;
  }
--- 146,150 ----
  	op->ob_type = &PyFloat_Type;
  	op->ob_fval = fval;
! 	_Py_NewReference((PyObject *)op);
  	return (PyObject *) op;
  }

Index: frameobject.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Objects/frameobject.c,v
retrieving revision 2.36
retrieving revision 2.37
diff -C2 -r2.36 -r2.37
*** frameobject.c	1998/10/19 14:20:20	2.36
--- frameobject.c	2000/01/20 22:32:54	2.37
***************
*** 185,189 ****
  			return (PyFrameObject *)PyErr_NoMemory();
  		f->ob_type = &PyFrame_Type;
! 		_Py_NewReference(f);
  	}
  	else {
--- 185,189 ----
  			return (PyFrameObject *)PyErr_NoMemory();
  		f->ob_type = &PyFrame_Type;
! 		_Py_NewReference((PyObject *)f);
  	}
  	else {
***************
*** 200,204 ****
  			extras = f->f_nlocals + f->f_stacksize;
  		f->ob_type = &PyFrame_Type;
! 		_Py_NewReference(f);
  	}
  	if (builtins == NULL) {
--- 200,204 ----
  			extras = f->f_nlocals + f->f_stacksize;
  		f->ob_type = &PyFrame_Type;
! 		_Py_NewReference((PyObject *)f);
  	}
  	if (builtins == NULL) {

Index: intobject.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Objects/intobject.c,v
retrieving revision 2.36
retrieving revision 2.37
diff -C2 -r2.36 -r2.37
*** intobject.c	1999/10/12 19:54:48	2.36
--- intobject.c	2000/01/20 22:32:54	2.37
***************
*** 169,173 ****
  	v->ob_type = &PyInt_Type;
  	v->ob_ival = ival;
! 	_Py_NewReference(v);
  #if NSMALLNEGINTS + NSMALLPOSINTS > 0
  	if (-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS) {
--- 169,173 ----
  	v->ob_type = &PyInt_Type;
  	v->ob_ival = ival;
! 	_Py_NewReference((PyObject *)v);
  #if NSMALLNEGINTS + NSMALLPOSINTS > 0
  	if (-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS) {

Index: listobject.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Objects/listobject.c,v
retrieving revision 2.62
retrieving revision 2.63
diff -C2 -r2.62 -r2.63
*** listobject.c	1999/06/09 15:19:34	2.62
--- listobject.c	2000/01/20 22:32:54	2.63
***************
*** 89,93 ****
  	for (i = 0; i < size; i++)
  		op->ob_item[i] = NULL;
! 	_Py_NewReference(op);
  	return (PyObject *) op;
  }
--- 89,93 ----
  	for (i = 0; i < size; i++)
  		op->ob_item[i] = NULL;
! 	_Py_NewReference((PyObject *)op);
  	return (PyObject *) op;
  }

Index: methodobject.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Objects/methodobject.c,v
retrieving revision 2.24
retrieving revision 2.25
diff -C2 -r2.24 -r2.25
*** methodobject.c	1998/12/04 18:52:55	2.24
--- methodobject.c	2000/01/20 22:32:54	2.25
***************
*** 48,52 ****
  		free_list = (PyCFunctionObject *)(op->m_self);
  		op->ob_type = &PyCFunction_Type;
! 		_Py_NewReference(op);
  	}
  	else {
--- 48,52 ----
  		free_list = (PyCFunctionObject *)(op->m_self);
  		op->ob_type = &PyCFunction_Type;
! 		_Py_NewReference((PyObject *)op);
  	}
  	else {

Index: object.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Objects/object.c,v
retrieving revision 2.61
retrieving revision 2.62
diff -C2 -r2.61 -r2.62
*** object.c	2000/01/12 16:28:58	2.61
--- object.c	2000/01/20 22:32:54	2.62
***************
*** 35,39 ****
  
  #if defined( Py_TRACE_REFS ) || defined( Py_REF_DEBUG )
! long _Py_RefTotal;
  #endif
  
--- 35,39 ----
  
  #if defined( Py_TRACE_REFS ) || defined( Py_REF_DEBUG )
! DL_IMPORT(long) _Py_RefTotal;
  #endif
  
***************
*** 150,154 ****
  	op->ob_type = tp;
  	op->ob_size = size;
! 	_Py_NewReference(op);
  	return op;
  }
--- 150,154 ----
  	op->ob_type = tp;
  	op->ob_size = size;
! 	_Py_NewReference((PyObject *)op);
  	return op;
  }
***************
*** 652,656 ****
--- 652,658 ----
  	register PyObject *op;
  {
+ #ifdef SLOW_UNREF_CHECK
  	register PyObject *p;
+ #endif
  	if (op->ob_refcnt < 0)
  		Py_FatalError("UNREF negative refcnt");

Index: stringobject.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Objects/stringobject.c,v
retrieving revision 2.53
retrieving revision 2.54
diff -C2 -r2.53 -r2.54
*** stringobject.c	1999/12/15 02:22:52	2.53
--- stringobject.c	2000/01/20 22:32:54	2.54
***************
*** 105,109 ****
  	op->ob_sinterned = NULL;
  #endif
! 	_Py_NewReference(op);
  	if (str != NULL)
  		memcpy(op->ob_sval, str, size);
--- 105,109 ----
  	op->ob_sinterned = NULL;
  #endif
! 	_Py_NewReference((PyObject *)op);
  	if (str != NULL)
  		memcpy(op->ob_sval, str, size);
***************
*** 155,159 ****
  	op->ob_sinterned = NULL;
  #endif
! 	_Py_NewReference(op);
  	strcpy(op->ob_sval, str);
  #ifndef DONT_SHARE_SHORT_STRINGS
--- 155,159 ----
  	op->ob_sinterned = NULL;
  #endif
! 	_Py_NewReference((PyObject *)op);
  	strcpy(op->ob_sval, str);
  #ifndef DONT_SHARE_SHORT_STRINGS
***************
*** 318,322 ****
  	op->ob_sinterned = NULL;
  #endif
! 	_Py_NewReference(op);
  	memcpy(op->ob_sval, a->ob_sval, (int) a->ob_size);
  	memcpy(op->ob_sval + a->ob_size, b->ob_sval, (int) b->ob_size);
--- 318,322 ----
  	op->ob_sinterned = NULL;
  #endif
! 	_Py_NewReference((PyObject *)op);
  	memcpy(op->ob_sval, a->ob_sval, (int) a->ob_size);
  	memcpy(op->ob_sval + a->ob_size, b->ob_sval, (int) b->ob_size);
***************
*** 353,357 ****
  	op->ob_sinterned = NULL;
  #endif
! 	_Py_NewReference(op);
  	for (i = 0; i < size; i += a->ob_size)
  		memcpy(op->ob_sval+i, a->ob_sval, (int) a->ob_size);
--- 353,357 ----
  	op->ob_sinterned = NULL;
  #endif
! 	_Py_NewReference((PyObject *)op);
  	for (i = 0; i < size; i += a->ob_size)
  		memcpy(op->ob_sval+i, a->ob_sval, (int) a->ob_size);

Index: tupleobject.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Objects/tupleobject.c,v
retrieving revision 2.28
retrieving revision 2.29
diff -C2 -r2.28 -r2.29
*** tupleobject.c	1999/07/13 05:41:12	2.28
--- tupleobject.c	2000/01/20 22:32:54	2.29
***************
*** 101,105 ****
  	for (i = 0; i < size; i++)
  		op->ob_item[i] = NULL;
! 	_Py_NewReference(op);
  #if MAXSAVESIZE > 0
  	if (size == 0) {
--- 101,105 ----
  	for (i = 0; i < size; i++)
  		op->ob_item[i] = NULL;
! 	_Py_NewReference((PyObject *)op);
  #if MAXSAVESIZE > 0
  	if (size == 0) {
***************
*** 453,457 ****
  	--_Py_RefTotal;
  #endif
! 	_Py_ForgetReference(v);
  	if (last_is_sticky && sizediff < 0) {
  		/* shrinking:
--- 453,457 ----
  	--_Py_RefTotal;
  #endif
! 	_Py_ForgetReference((PyObject *)v);
  	if (last_is_sticky && sizediff < 0) {
  		/* shrinking:
***************
*** 476,480 ****
  		return -1;
  	}
! 	_Py_NewReference(sv);
  	for (i = sv->ob_size; i < newsize; i++)
  		sv->ob_item[i] = NULL;
--- 476,480 ----
  		return -1;
  	}
! 	_Py_NewReference((PyObject *)sv);
  	for (i = sv->ob_size; i < newsize; i++)
  		sv->ob_item[i] = NULL;