[Python-checkins] CVS: python/dist/src/Objects object.c,2.124.4.12,2.124.4.13

Guido van Rossum gvanrossum@users.sourceforge.net
Thu, 07 Jun 2001 11:31:57 -0700


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

Modified Files:
      Tag: descr-branch
	object.c 
Log Message:
Change the signature of _PyObject_TypeCheck() to take two type
objects; change PyObject_TypeCheck() to hide the change from its
users.  This might generate faster code if the compiler notices that
(ob)->ob_type is loaded twice.  It also (and this was the real reason
to do this now) avoids warnings when op is not a PyObject * but a
derived object, e.g. a PyTypeObject *.



Index: object.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v
retrieving revision 2.124.4.12
retrieving revision 2.124.4.13
diff -C2 -r2.124.4.12 -r2.124.4.13
*** object.c	2001/06/06 14:34:13	2.124.4.12
--- object.c	2001/06/07 18:31:55	2.124.4.13
***************
*** 1327,1334 ****
  
  int
! _PyObject_TypeCheck(PyObject *obj, PyTypeObject *type)
  {
- 	PyTypeObject *tp = obj->ob_type;
- 
  	do {
  		if (tp == type)
--- 1327,1332 ----
  
  int
! _PyObject_TypeCheck(PyTypeObject *tp, PyTypeObject *type)
  {
  	do {
  		if (tp == type)