[Python-checkins] CVS: python/dist/src/Objects floatobject.c,2.96,2.97 intobject.c,2.72,2.73
Guido van Rossum
gvanrossum@users.sourceforge.net
Tue, 11 Sep 2001 09:13:54 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv6146/Objects
Modified Files:
floatobject.c intobject.c
Log Message:
Replace a few places where X->ob_type was compared to &PyXXX_Type with
calls to PyXXX_CheckExact(X).
Index: floatobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v
retrieving revision 2.96
retrieving revision 2.97
diff -C2 -d -r2.96 -r2.97
*** floatobject.c 2001/09/05 23:49:24 2.96
--- floatobject.c 2001/09/11 16:13:52 2.97
***************
*** 776,780 ****
i < N_FLOATOBJECTS;
i++, p++) {
! if (p->ob_type == &PyFloat_Type && p->ob_refcnt != 0)
frem++;
}
--- 776,780 ----
i < N_FLOATOBJECTS;
i++, p++) {
! if (PyFloat_CheckExact(p) && p->ob_refcnt != 0)
frem++;
}
***************
*** 786,790 ****
i < N_FLOATOBJECTS;
i++, p++) {
! if (p->ob_type != &PyFloat_Type ||
p->ob_refcnt == 0) {
p->ob_type = (struct _typeobject *)
--- 786,790 ----
i < N_FLOATOBJECTS;
i++, p++) {
! if (!PyFloat_CheckExact(p) ||
p->ob_refcnt == 0) {
p->ob_type = (struct _typeobject *)
***************
*** 819,823 ****
i < N_FLOATOBJECTS;
i++, p++) {
! if (p->ob_type == &PyFloat_Type &&
p->ob_refcnt != 0) {
char buf[100];
--- 819,823 ----
i < N_FLOATOBJECTS;
i++, p++) {
! if (PyFloat_CheckExact(p) &&
p->ob_refcnt != 0) {
char buf[100];
Index: intobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v
retrieving revision 2.72
retrieving revision 2.73
diff -C2 -d -r2.72 -r2.73
*** intobject.c 2001/09/05 06:24:58 2.72
--- intobject.c 2001/09/11 16:13:52 2.73
***************
*** 135,139 ****
int_dealloc(PyIntObject *v)
{
! if (v->ob_type == &PyInt_Type) {
v->ob_type = (struct _typeobject *)free_list;
free_list = v;
--- 135,139 ----
int_dealloc(PyIntObject *v)
{
! if (PyInt_CheckExact(v)) {
v->ob_type = (struct _typeobject *)free_list;
free_list = v;
***************
*** 1000,1004 ****
i < N_INTOBJECTS;
i++, p++) {
! if (p->ob_type == &PyInt_Type && p->ob_refcnt != 0)
irem++;
}
--- 1000,1004 ----
i < N_INTOBJECTS;
i++, p++) {
! if (PyInt_CheckExact(p) && p->ob_refcnt != 0)
irem++;
}
***************
*** 1010,1014 ****
i < N_INTOBJECTS;
i++, p++) {
! if (p->ob_type != &PyInt_Type ||
p->ob_refcnt == 0) {
p->ob_type = (struct _typeobject *)
--- 1010,1014 ----
i < N_INTOBJECTS;
i++, p++) {
! if (!PyInt_CheckExact(p) ||
p->ob_refcnt == 0) {
p->ob_type = (struct _typeobject *)
***************
*** 1053,1057 ****
i < N_INTOBJECTS;
i++, p++) {
! if (p->ob_type == &PyInt_Type && p->ob_refcnt != 0)
fprintf(stderr,
"# <int at %p, refcnt=%d, val=%ld>\n",
--- 1053,1057 ----
i < N_INTOBJECTS;
i++, p++) {
! if (PyInt_CheckExact(p) && p->ob_refcnt != 0)
fprintf(stderr,
"# <int at %p, refcnt=%d, val=%ld>\n",