On 8/21/06, Alexander Belopolsky <alexander.belopolsky at gmail.com> wrote: > Here is a similar problem: > typedef struct { > ... > size_t pos; > ... > } mmap_object; > ... > mmap_tell_method(mmap_object *self, PyObject *unused) > { > CHECK_VALID(NULL); > return PyInt_FromLong((long) self->pos); > } > > See Modules/mmapmodule.c . > > Here a cast to ssize_t would, technically speaking, not be safe > either, but it may be worth using ssize_t anyways. It should call PyInt_FromSize_t, without any casting. That will make it a PyLong if it's bigger than a Py_ssize_t, too. Is there a simple automated way to detect situations like this? Maybe > there is a win64 compiler that would generate a warning. > I doubt it. Explicit casts are meant to silence warnings (among other things.) Warning for all casts is bound to generate quite a lot of warnings. -- 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-dev/attachments/20060821/3f0f7968/attachment.htm
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4