[Python-checkins] r46642 - in python/trunk: Lib/socket.py Lib/struct.py Lib/test/test_socket.py Lib/test/test_struct.py Modules/_struct.c Modules/socketmodule.c

Thomas Wouters thomas at python.org
Sun Jun 4 23:55:01 CEST 2006


On 6/4/06, martin.blais <python-checkins at python.org> wrote:
>
>
> - Converted some ints into the appropriate -- I hope -- ssize_t and
> size_t.


Python-API things should be using Py_ssize_t, not ssize_t. I'm not sure what
to do about non-Python-API things, like the returnvalue of recv(), though.
The ssize_t type apparently isn't always available. I don't think using
Py_ssize_t is the right thing to do, in those cases; it's not what
Py_ssize_t is meant for, although I can't think of a practical example of
problems it would cause. 'int' is certainly the wrong type to use, though,
so if we can make sure ssize_t exists whenever socketmodule gets compiled,
I'm happy. Cursory glances suggest that won't be the case, though (but
socketmodule's #ifdef forest makes it hard to tell.)

Martin, any comments about the availability of ssize_t and the use of
Py_ssize_t instead?

-- 
Thomas Wouters <thomas at python.org>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-checkins/attachments/20060604/8c4f7497/attachment.htm 


More information about the Python-checkins mailing list