summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/classobject.c6
-rw-r--r--Objects/complexobject.c2
-rw-r--r--Objects/floatobject.c2
-rw-r--r--Objects/frameobject.c4
-rw-r--r--Objects/intobject.c2
-rw-r--r--Objects/listobject.c2
-rw-r--r--Objects/methodobject.c2
-rw-r--r--Objects/object.c6
-rw-r--r--Objects/stringobject.c8
-rw-r--r--Objects/tupleobject.c6
10 files changed, 21 insertions, 19 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 6d49228..adf49ba 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -504,7 +504,7 @@ instance_dealloc(inst)
/* much too complicated if Py_TRACE_REFS defined */
extern long _Py_RefTotal;
inst->ob_type = &PyInstance_Type;
- _Py_NewReference(inst);
+ _Py_NewReference((PyObject *)inst);
_Py_RefTotal--; /* compensate for increment in NEWREF */
#ifdef COUNT_ALLOCS
inst->ob_type->tp_alloc--; /* ditto */
@@ -556,7 +556,7 @@ instance_dealloc(inst)
#ifdef COUNT_ALLOCS
inst->ob_type->tp_free--; /* compensate for increment in UNREF */
#endif
- _Py_ForgetReference(inst);
+ _Py_ForgetReference((PyObject *)inst);
inst->ob_type = NULL;
#endif /* Py_TRACE_REFS */
Py_DECREF(inst->in_class);
@@ -1431,7 +1431,7 @@ PyMethod_New(func, self, class)
if (im != NULL) {
free_list = (PyMethodObject *)(im->im_self);
im->ob_type = &PyMethod_Type;
- _Py_NewReference(im);
+ _Py_NewReference((PyObject *)im);
}
else {
im = PyObject_NEW(PyMethodObject, &PyMethod_Type);
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index e8447bb..ac95e8b 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -172,7 +172,7 @@ PyComplex_FromCComplex(cval)
return PyErr_NoMemory();
op->ob_type = &PyComplex_Type;
op->cval = cval;
- _Py_NewReference(op);
+ _Py_NewReference((PyObject *)op);
return (PyObject *) op;
}
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 557a641..6430a98 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -145,7 +145,7 @@ PyFloat_FromDouble(fval)
free_list = (PyFloatObject *)op->ob_type;
op->ob_type = &PyFloat_Type;
op->ob_fval = fval;
- _Py_NewReference(op);
+ _Py_NewReference((PyObject *)op);
return (PyObject *) op;
}
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 64fc52f..dcd760c 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -184,7 +184,7 @@ PyFrame_New(tstate, code, globals, locals)
if (f == NULL)
return (PyFrameObject *)PyErr_NoMemory();
f->ob_type = &PyFrame_Type;
- _Py_NewReference(f);
+ _Py_NewReference((PyObject *)f);
}
else {
f = free_list;
@@ -199,7 +199,7 @@ PyFrame_New(tstate, code, globals, locals)
else
extras = f->f_nlocals + f->f_stacksize;
f->ob_type = &PyFrame_Type;
- _Py_NewReference(f);
+ _Py_NewReference((PyObject *)f);
}
if (builtins == NULL) {
/* No builtins! Make up a minimal one. */
diff --git a/Objects/intobject.c b/Objects/intobject.c
index 45c2186..00fdf82 100644
--- a/Objects/intobject.c
+++ b/Objects/intobject.c
@@ -168,7 +168,7 @@ PyInt_FromLong(ival)
free_list = (PyIntObject *)v->ob_type;
v->ob_type = &PyInt_Type;
v->ob_ival = ival;
- _Py_NewReference(v);
+ _Py_NewReference((PyObject *)v);
#if NSMALLNEGINTS + NSMALLPOSINTS > 0
if (-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS) {
/* save this one for a following allocation */
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 0342cdc..4caa6df 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -88,7 +88,7 @@ PyList_New(size)
op->ob_size = size;
for (i = 0; i < size; i++)
op->ob_item[i] = NULL;
- _Py_NewReference(op);
+ _Py_NewReference((PyObject *)op);
return (PyObject *) op;
}
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index e7de73a..5c69744 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -47,7 +47,7 @@ PyCFunction_New(ml, self)
if (op != NULL) {
free_list = (PyCFunctionObject *)(op->m_self);
op->ob_type = &PyCFunction_Type;
- _Py_NewReference(op);
+ _Py_NewReference((PyObject *)op);
}
else {
op = PyObject_NEW(PyCFunctionObject, &PyCFunction_Type);
diff --git a/Objects/object.c b/Objects/object.c
index ee9c271..69ad23d 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -34,7 +34,7 @@ PERFORMANCE OF THIS SOFTWARE.
#include "Python.h"
#if defined( Py_TRACE_REFS ) || defined( Py_REF_DEBUG )
-long _Py_RefTotal;
+DL_IMPORT(long) _Py_RefTotal;
#endif
/* Object allocation routines used by NEWOBJ and NEWVAROBJ macros.
@@ -149,7 +149,7 @@ _PyObject_NewVar(tp, size, op)
return (PyVarObject *)PyErr_NoMemory();
op->ob_type = tp;
op->ob_size = size;
- _Py_NewReference(op);
+ _Py_NewReference((PyObject *)op);
return op;
}
@@ -651,7 +651,9 @@ void
_Py_ForgetReference(op)
register PyObject *op;
{
+#ifdef SLOW_UNREF_CHECK
register PyObject *p;
+#endif
if (op->ob_refcnt < 0)
Py_FatalError("UNREF negative refcnt");
if (op == &refchain ||
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index dc47f9e..cb264e9 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -104,7 +104,7 @@ PyString_FromStringAndSize(str, size)
#ifdef INTERN_STRINGS
op->ob_sinterned = NULL;
#endif
- _Py_NewReference(op);
+ _Py_NewReference((PyObject *)op);
if (str != NULL)
memcpy(op->ob_sval, str, size);
op->ob_sval[size] = '\0';
@@ -154,7 +154,7 @@ PyString_FromString(str)
#ifdef INTERN_STRINGS
op->ob_sinterned = NULL;
#endif
- _Py_NewReference(op);
+ _Py_NewReference((PyObject *)op);
strcpy(op->ob_sval, str);
#ifndef DONT_SHARE_SHORT_STRINGS
if (size == 0) {
@@ -317,7 +317,7 @@ string_concat(a, bb)
#ifdef INTERN_STRINGS
op->ob_sinterned = NULL;
#endif
- _Py_NewReference(op);
+ _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);
op->ob_sval[size] = '\0';
@@ -352,7 +352,7 @@ string_repeat(a, n)
#ifdef INTERN_STRINGS
op->ob_sinterned = NULL;
#endif
- _Py_NewReference(op);
+ _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);
op->ob_sval[size] = '\0';
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 18b3315..568c4b3 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -100,7 +100,7 @@ PyTuple_New(size)
}
for (i = 0; i < size; i++)
op->ob_item[i] = NULL;
- _Py_NewReference(op);
+ _Py_NewReference((PyObject *)op);
#if MAXSAVESIZE > 0
if (size == 0) {
free_tuples[0] = op;
@@ -452,7 +452,7 @@ _PyTuple_Resize(pv, newsize, last_is_sticky)
#ifdef Py_REF_DEBUG
--_Py_RefTotal;
#endif
- _Py_ForgetReference(v);
+ _Py_ForgetReference((PyObject *)v);
if (last_is_sticky && sizediff < 0) {
/* shrinking:
move entries to the front and zero moved entries */
@@ -475,7 +475,7 @@ _PyTuple_Resize(pv, newsize, last_is_sticky)
PyErr_NoMemory();
return -1;
}
- _Py_NewReference(sv);
+ _Py_NewReference((PyObject *)sv);
for (i = sv->ob_size; i < newsize; i++)
sv->ob_item[i] = NULL;
if (last_is_sticky && sizediff > 0) {