summaryrefslogtreecommitdiff
path: root/Objects/intobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-11 16:13:52 +0000
committerGuido van Rossum <guido@python.org>2001-09-11 16:13:52 +0000
commitdea6ef9bfd6f04d216e46bb9537d6991f2be6348 (patch)
treef90fbcd135632d62f9f84856e810a21ca5a7c31f /Objects/intobject.c
parentae01046f7bf846dd984e89cf84e83d6ad0f45afd (diff)
downloadcpython-git-dea6ef9bfd6f04d216e46bb9537d6991f2be6348.tar.gz
Replace a few places where X->ob_type was compared to &PyXXX_Type with
calls to PyXXX_CheckExact(X).
Diffstat (limited to 'Objects/intobject.c')
-rw-r--r--Objects/intobject.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c
index 12edb51002..261edb8443 100644
--- a/Objects/intobject.c
+++ b/Objects/intobject.c
@@ -134,7 +134,7 @@ PyInt_FromLong(long ival)
static void
int_dealloc(PyIntObject *v)
{
- if (v->ob_type == &PyInt_Type) {
+ if (PyInt_CheckExact(v)) {
v->ob_type = (struct _typeobject *)free_list;
free_list = v;
}
@@ -999,7 +999,7 @@ PyInt_Fini(void)
for (i = 0, p = &list->objects[0];
i < N_INTOBJECTS;
i++, p++) {
- if (p->ob_type == &PyInt_Type && p->ob_refcnt != 0)
+ if (PyInt_CheckExact(p) && p->ob_refcnt != 0)
irem++;
}
next = list->next;
@@ -1009,7 +1009,7 @@ PyInt_Fini(void)
for (i = 0, p = &list->objects[0];
i < N_INTOBJECTS;
i++, p++) {
- if (p->ob_type != &PyInt_Type ||
+ if (!PyInt_CheckExact(p) ||
p->ob_refcnt == 0) {
p->ob_type = (struct _typeobject *)
free_list;
@@ -1052,7 +1052,7 @@ PyInt_Fini(void)
for (i = 0, p = &list->objects[0];
i < N_INTOBJECTS;
i++, p++) {
- if (p->ob_type == &PyInt_Type && p->ob_refcnt != 0)
+ if (PyInt_CheckExact(p) && p->ob_refcnt != 0)
fprintf(stderr,
"# <int at %p, refcnt=%d, val=%ld>\n",
p, p->ob_refcnt, p->ob_ival);