[Bf-python] tp_getset conversion update

Stephen Swaney sswaney at centurytel.net
Sat Sep 17 23:26:51 CEST 2005


On Fri, Sep 16, 2005 at 07:45:28AM -0700, Ken Hughes wrote:
> Thought I'd give everyone an update on the status of converting the API 
> to use tp_getset:
> 
> Submitted: 5 modules
> ---------
> Lamp.c
> Material.c
> Texture.c
> rgbTuple.c
> gen_utils.c (more changes possible)

I made a quick pass thru Patch #3043 which is a roll-up
patch for all the previous patches to these modules.
Things look pretty good; patch applies and compiles, 
included tests pass.

The only issue I see is that we get about 70 warnings about
" ISO C forbids passing arg 3 of `EXPP_setterWrapper' between 
function pointer and `void *'".  We already get hammered about 
warnings in bpy code, so I don't think adding 70 of them at one
time is good.  There may also be issues compiling this on MSVC or 
Irix, but I have not checked.  I do know they tend to be pickier
than good old friendly gcc.

To use Lamp as an example, we probably need to do something like
the following rather than casting arg 3 to void*:

typedef int (*PYFUNC)( PyObject *self, PyObject *args);

static PyObject *Lamp_oldsetName( BPy_Lamp * self, PyObject * args )
{
	return EXPP_setterWrapper ( (void *)self, args, (PYFUNC)Lamp_setName );
}

Obviously, if the solution is a typedef, it needs to go someplace other
than in each source module.

-- 
Stephen Swaney			
sswaney at centurytel.net




More information about the Bf-python mailing list