Mercurial > cpython-lru_cache-weakref
diff Objects/bytesobject.c @ 44099:f324631462a2
Cleanup: Replaced most PyInt_ aliases with PyLong_ and disabled the aliases in intobject.h
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Sun, 02 Dec 2007 14:31:20 +0000 |
| parents | cbc8b3bd3157 |
| children | 825cffd6c0cd |
line wrap: on
line diff
--- a/Objects/bytesobject.c Sun Dec 02 09:40:06 2007 +0000 +++ b/Objects/bytesobject.c Sun Dec 02 14:31:20 2007 +0000 @@ -34,8 +34,8 @@ { long face_value; - if (PyInt_Check(arg)) { - face_value = PyInt_AsLong(arg); + if (PyLong_Check(arg)) { + face_value = PyLong_AsLong(arg); if (face_value < 0 || face_value >= 256) { PyErr_SetString(PyExc_ValueError, "byte must be in range(0, 256)"); return 0; @@ -350,7 +350,7 @@ PyErr_SetString(PyExc_IndexError, "bytearray index out of range"); return NULL; } - return PyInt_FromLong((unsigned char)(self->ob_bytes[i])); + return PyLong_FromLong((unsigned char)(self->ob_bytes[i])); } static PyObject * @@ -369,7 +369,7 @@ PyErr_SetString(PyExc_IndexError, "bytearray index out of range"); return NULL; } - return PyInt_FromLong((unsigned char)(self->ob_bytes[i])); + return PyLong_FromLong((unsigned char)(self->ob_bytes[i])); } else if (PySlice_Check(item)) { Py_ssize_t start, stop, step, slicelength, cur, i; @@ -1091,7 +1091,7 @@ Py_ssize_t result = bytes_find_internal(self, args, +1); if (result == -2) return NULL; - return PyInt_FromSsize_t(result); + return PyLong_FromSsize_t(result); } PyDoc_STRVAR(count__doc__, @@ -1119,7 +1119,7 @@ _adjust_indices(&start, &end, PyBytes_GET_SIZE(self)); - count_obj = PyInt_FromSsize_t( + count_obj = PyLong_FromSsize_t( stringlib_count(str + start, end - start, vsub.buf, vsub.len) ); PyObject_ReleaseBuffer(sub_obj, &vsub); @@ -1143,7 +1143,7 @@ "subsection not found"); return NULL; } - return PyInt_FromSsize_t(result); + return PyLong_FromSsize_t(result); } @@ -1162,7 +1162,7 @@ Py_ssize_t result = bytes_find_internal(self, args, -1); if (result == -2) return NULL; - return PyInt_FromSsize_t(result); + return PyLong_FromSsize_t(result); } @@ -1182,7 +1182,7 @@ "subsection not found"); return NULL; } - return PyInt_FromSsize_t(result); + return PyLong_FromSsize_t(result); } @@ -2622,7 +2622,7 @@ if (PyBytes_Resize((PyObject *)self, n - 1) < 0) return NULL; - return PyInt_FromLong(value); + return PyLong_FromLong(value); } PyDoc_STRVAR(remove__doc__, @@ -2809,7 +2809,7 @@ static PyObject * bytes_alloc(PyBytesObject *self) { - return PyInt_FromSsize_t(self->ob_alloc); + return PyLong_FromSsize_t(self->ob_alloc); } PyDoc_STRVAR(join_doc, @@ -3161,7 +3161,7 @@ assert(PyBytes_Check(seq)); if (it->it_index < PyBytes_GET_SIZE(seq)) { - item = PyInt_FromLong( + item = PyLong_FromLong( (unsigned char)seq->ob_bytes[it->it_index]); if (item != NULL) ++it->it_index; @@ -3179,7 +3179,7 @@ Py_ssize_t len = 0; if (it->it_seq) len = PyBytes_GET_SIZE(it->it_seq) - it->it_index; - return PyInt_FromSsize_t(len); + return PyLong_FromSsize_t(len); } PyDoc_STRVAR(length_hint_doc,
