[Python-checkins] CVS: python/dist/src/Include object.h,2.79.2.12,2.79.2.13
Guido van Rossum
gvanrossum@users.sourceforge.net
Thu, 07 Jun 2001 11:31:57 -0700
Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv31479/Include
Modified Files:
Tag: descr-branch
object.h
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.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/object.h,v
retrieving revision 2.79.2.12
retrieving revision 2.79.2.13
diff -C2 -r2.79.2.12 -r2.79.2.13
*** object.h 2001/06/06 14:41:45 2.79.2.12
--- object.h 2001/06/07 18:31:55 2.79.2.13
***************
*** 287,293 ****
/* Generic type check */
! extern DL_IMPORT(int) _PyObject_TypeCheck(PyObject *, PyTypeObject *);
#define PyObject_TypeCheck(ob, tp) \
! ((ob)->ob_type == (tp) || _PyObject_TypeCheck(ob, tp))
extern DL_IMPORT(PyTypeObject) PyType_Type; /* Metatype */
--- 287,293 ----
/* Generic type check */
! extern DL_IMPORT(int) _PyObject_TypeCheck(PyTypeObject *, PyTypeObject *);
#define PyObject_TypeCheck(ob, tp) \
! ((ob)->ob_type == (tp) || _PyObject_TypeCheck((ob)->ob_type, (tp)))
extern DL_IMPORT(PyTypeObject) PyType_Type; /* Metatype */