[Numpy-discussion] fwrite() failure in PyArray_ToFile
Charles R Harris
Sat Sep 5 00:01:30 CDT 2009
On Fri, Sep 4, 2009 at 10:29 PM, Sturla Molden <email@example.com> wrote:
> Charles R Harris skrev:
> > The size of long depends on the compiler as well as the operating
> > system. On linux x86_64, IIRC, it is 64 bits, on Windows64 I believe
> > it is 32. Ints always seem to be 32 bits.
> If I remember the C standard correctly, a long is guaranteed to be at
> least 32 bits, whereas an int is guaranteed to be at least 16 bits. A
> short is at least 16 bits and a long long is 64 bits. Then there is
> intptr_t which is wide enough to store a pointer, but could be wider. A
> size_t usually has the size of a pointer but not always (on segment and
> offset architectures they might differ). Considering PEP353, should we
> be indexing with Py_ssize_t instead of npy_intp? I believe (correct me
> if I'm wrong) npy_intp is typedef'ed to Py_intptr_t.
The problem is that Py_ssize_t showed up in Python 2.5 and we support 2.4.
For earlier versions folks usually typedef Py_ssize_t to int, which works
for python compatibility but would cause problems for us if we used it as
the npy_intp type.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion