[Python-Dev] int vs ssize_t in unicode

Neal Norwitz nnorwitz at gmail.com
Thu Apr 13 07:44:26 CEST 2006


Martin,

In Include/ucnhash.h I notice some integers and wonder if those should
be Py_ssize_t.  It looks like they are just names so they should be
pretty short.

But in Objects/unicodeobject.c, I notice a bunch of ints and casts to
int and wonder if they should be changed to Py_ssize_t/removed:

235:
        assert(length<INT_MAX);
    unicode->length = (int)length;

376, 404:
  int i;


1366: (seems like this could be a 64-bit value)
  int nneeded;

(i stopped at this point, there are probably more)


Modules/unicodedata.c (lots of ints, not sure if they are a problem)

494:
    isize = PyUnicode_GET_SIZE(input);

n


More information about the Python-Dev mailing list