summaryrefslogtreecommitdiffstats
path: root/Modules/_randommodule.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-12-02 14:31:20 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-12-02 14:31:20 (GMT)
commit217cfd1c86c59ed8a55ce6d6b88bbe37309e7ba2 (patch)
tree4737b4a91359c94953623ab9ee297e9a90f319e4 /Modules/_randommodule.c
parent1a3284ed69d545e4ef59869998cb8c29233a45fa (diff)
downloadcpython-217cfd1c86c59ed8a55ce6d6b88bbe37309e7ba2.zip
cpython-217cfd1c86c59ed8a55ce6d6b88bbe37309e7ba2.tar.gz
cpython-217cfd1c86c59ed8a55ce6d6b88bbe37309e7ba2.tar.bz2
Cleanup: Replaced most PyInt_ aliases with PyLong_ and disabled the aliases in intobject.h
Diffstat (limited to 'Modules/_randommodule.c')
-rw-r--r--Modules/_randommodule.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c
index bd4d17e..3256bf1 100644
--- a/Modules/_randommodule.c
+++ b/Modules/_randommodule.c
@@ -259,7 +259,7 @@ random_seed(RandomObject *self, PyObject *args)
masklower = PyLong_FromUnsignedLong(0xffffffffU);
if (masklower == NULL)
goto Done;
- thirtytwo = PyInt_FromLong(32L);
+ thirtytwo = PyLong_FromLong(32L);
if (thirtytwo == NULL)
goto Done;
while ((err=PyObject_IsTrue(n))) {
@@ -319,12 +319,12 @@ random_getstate(RandomObject *self)
if (state == NULL)
return NULL;
for (i=0; i<N ; i++) {
- element = PyInt_FromLong((long)(self->state[i]));
+ element = PyLong_FromLong((long)(self->state[i]));
if (element == NULL)
goto Fail;
PyTuple_SET_ITEM(state, i, element);
}
- element = PyInt_FromLong((long)(self->index));
+ element = PyLong_FromLong((long)(self->index));
if (element == NULL)
goto Fail;
PyTuple_SET_ITEM(state, i, element);
@@ -353,13 +353,13 @@ random_setstate(RandomObject *self, PyObject *state)
}
for (i=0; i<N ; i++) {
- element = PyInt_AsLong(PyTuple_GET_ITEM(state, i));
+ element = PyLong_AsLong(PyTuple_GET_ITEM(state, i));
if (element == -1 && PyErr_Occurred())
return NULL;
self->state[i] = (unsigned long)element;
}
- element = PyInt_AsLong(PyTuple_GET_ITEM(state, i));
+ element = PyLong_AsLong(PyTuple_GET_ITEM(state, i));
if (element == -1 && PyErr_Occurred())
return NULL;
self->index = (int)element;
@@ -410,14 +410,14 @@ random_jumpahead(RandomObject *self, PyObject *n)
mt = self->state;
for (i = N-1; i > 1; i--) {
- iobj = PyInt_FromLong(i);
+ iobj = PyLong_FromLong(i);
if (iobj == NULL)
return NULL;
remobj = PyNumber_Remainder(n, iobj);
Py_DECREF(iobj);
if (remobj == NULL)
return NULL;
- j = PyInt_AsLong(remobj);
+ j = PyLong_AsLong(remobj);
Py_DECREF(remobj);
if (j == -1L && PyErr_Occurred())
return NULL;