[Python-Dev] ssize_t branch merged (original) (raw)

Travis Oliphant oliphant.travis at ieee.org
Sat Feb 18 02:37:32 CET 2006


Thomas Wouters wrote:

On Fri, Feb 17, 2006 at 04:40:08PM -0700, Travis Oliphant wrote:

What is PYSSIZETMAX supposed to be? The definition in pyport.h doesn't compile.

Maybe I have the wrong version of code. In my pyport.h (checked out from svn trunk) I have.

#define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1))

What is size_t? Is this supposed to be sizeof(size_t)?

I get a syntax error when I actually use PY_SSIZE_T_MAX somewhere in the code.

While looking at the piece of code in Include/pyport.h I do notice that the fallback (when ssizet is not available) is to Pyuintptrt... Which is an unsigned type, while ssizet is supposed to be signed. Martin, is that on purpose? I don't have any systems that lack ssizet. ;P

I saw the same thing and figured it was an error.

Adapting all code in the right way isn't finished yet (not in the last place because some of the code is... how shall I put it... 'creative'.)

I'm just trying to adapt my index patch to use ssize_t. I realize this was a big change and will take some "adjusting." I can help with that if needed as I do have some experience here. I just want to make sure I fully understand what issues Martin and others are concerned about.

-Travis



More information about the Python-Dev mailing list