static
PyObject *codec_tuple(PyObject *unicode,
- int len)
+ Py_ssize_t len)
{
PyObject *v,*w;
return NULL;
}
PyTuple_SET_ITEM(v,0,unicode);
- w = PyInt_FromLong(len);
+ w = PyInt_FromSsize_t(len);
if (w == NULL) {
Py_DECREF(v);
return NULL;
PyObject *str;
const char *errors = NULL;
char *buf;
- int len;
+ Py_ssize_t len;
if (!PyArg_ParseTuple(args, "O!|z:escape_encode",
&PyString_Type, &str, &errors))
}
sname = PyString_AsString(name);
if (sname[0] == '_' && sname[1] == '_') {
- int n = PyString_Size(name);
+ Py_ssize_t n = PyString_Size(name);
if (sname[n-1] == '_' && sname[n-2] == '_') {
char *err = NULL;
if (strcmp(sname, "__dict__") == 0)
PyObject *mod = PyDict_GetItemString(op->cl_dict, "__module__");
PyObject *name = op->cl_name;
PyObject *res;
- int m, n;
+ Py_ssize_t m, n;
if (name == NULL || !PyString_Check(name))
return class_repr(op);
PyObject_GC_Del(inst);
}
else {
- int refcnt = inst->ob_refcnt;
+ Py_ssize_t refcnt = inst->ob_refcnt;
/* __del__ resurrected it! Make it look like the original
* Py_DECREF never happened.
*/
PyObject *func, *args, *res, *tmp;
char *sname = PyString_AsString(name);
if (sname[0] == '_' && sname[1] == '_') {
- int n = PyString_Size(name);
+ Py_ssize_t n = PyString_Size(name);
if (sname[n-1] == '_' && sname[n-2] == '_') {
if (strcmp(sname, "__dict__") == 0) {
if (PyEval_GetRestricted()) {
*/
PyErr_Clear();
return _PySequence_IterSearch((PyObject *)inst, member,
- PY_ITERSEARCH_CONTAINS);
+ PY_ITERSEARCH_CONTAINS) > 0;
}
else
return -1;
/* XXX move into writeobject() ? */
if (PyString_Check(v)) {
char *s = PyString_AS_STRING(v);
- int len = PyString_GET_SIZE(v);
+ Py_ssize_t len = PyString_GET_SIZE(v);
if (len == 0 ||
!isspace(Py_CHARMASK(s[len-1])) ||
s[len-1] == ' ')
#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(v)) {
Py_UNICODE *s = PyUnicode_AS_UNICODE(v);
- int len = PyUnicode_GET_SIZE(v);
+ Py_ssize_t len = PyUnicode_GET_SIZE(v);
if (len == 0 ||
!Py_UNICODE_ISSPACE(s[len-1]) ||
s[len-1] == ' ')