Dan wrote:

> def fitness(int new_image, int original_image, int size):
> 
>     cdef unsigned char *new_pixels = <unsigned char*><Py_ssize_t>size
>     cdef unsigned char *original_pixels = <unsigned char*><Py_ssize_t>size

I think you want to cast 'new_image' and 'original_image' there,
not 'size'!

Also, it would be safer to declare the parameters directly as
being of type Py_ssize_t instead of going through int, just in
case int is not big enough.

   def fitness(Py_ssize_t new_image, Py_ssize_t original_image, Py_ssize_t 
size):

     cdef unsigned char *new_pixels = <unsigned char*>new_image
     cdef unsigned char *original_pixels = <unsigned char*>original_image

-- 
Greg
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to