[Pyrex] Function Pointer

Marco Bubke marco at bubke.de
Fri Mar 5 01:05:01 CET 2004


On Friday 05 March 2004 00:41, Greg Ewing wrote:
> Marco Bubke <marco at bubke.de>:
> > cdef void tesselator_vertex(object vertex, object tesselator):
> >   print "vertex: ", vertex._indice
> >
> >   ...
> >
> >     gluTessCallback(self._tesselator, GLU_TESS_VERTEX_DATA,
> > 	<void(*)()>&tesselator_vertex)
>
> Are you sure that the arguments getting passed through to
> your callback are really Python objects (PyObject * in
> C terms)? If not, bad things could happen before the body
> of the callback is reached, even if the arguments aren't
> used anywhere in the body.
>
> Try using pure C functions as callbacks, with no Python
> arguments. That will tell you whether the callback is
> getting called at all.

Its not called. If the pointer is NULL there will be no call too. Maybe thats 
the problem. If I look at the C-Code the pointer cast looks like (void((*)
())). Is this right? I'm not a C guru.




More information about the Pyrex mailing list