On Mar 10, 2009, at 11:08 AM, Robert Bradshaw wrote: > I'll fix this. The problem is that when passing via the inline > function, the size and signness of the original index gets lost. The > very common and much faster case is to use PyInt_FromLong, but of > course we have to handle bigger indices as well. > > - Robert > > > On Mar 10, 2009, at 9:19 AM, Lisandro Dalcin wrote: > >> Here you have a trivial patch... However, all this part smells so >> bad... >> >> >> On Tue, Mar 10, 2009 at 1:38 PM, Stefan Behnel >> <[email protected]> wrote: >>> Lisandro Dalcin wrote: >>>>>> Now testing at least starts, but seems to have some errors: >>>>> >>>>> * warning: left shift count >= width of type
Note that this is only called when sizeof(Py_ssize_t) < sizeof (unsigned long long). >>>>> I don't get these locally. The problem is in __Pyx_GetItemGeneric, >>>>> second >>>>> line: "1ULL << (sizeof(Py_ssize_t)*8)". Looks like that's not >>>>> 64bit >>>>> clean. >>>> >>>> PyInt_FromSsize_t() should be used here.... Well, it's a bit more complicated than this. However, I will admit, though I tried to cover all the cases, the original code was quite hackish. I've come up with a better solution that doesn't sacrifice speed for the common cases. RC3 is up for testing. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
