[C++-sig] Code generation bug in pyplusplus

Niall Douglas s_sourceforge at nedprod.com
Tue Jun 13 00:25:54 CEST 2006


Back onto getting the python bindings for TnFOX working again. I'm 
using the latest from SVN.

Pyplusplus generates bad code here:

    FXPrimaryButton_wrapper(::FX::FXComposite * parent, 
::FX::FXString const & text, ::FX::FXIcon * icon=0, ::FX::FXObject * 
tgt=0, ::FX::FXSelector sel=0, ::FX::FXuint 
opts=::FX::FXuint(::FX::PBUTTON_NORMAL), ::FX::FXint x=0, ::FX::FXint 
y=0, ::FX::FXint w=0, ::FX::FXint h=0, ::FX::FXint 
pl=(FX::FXWindow::defaultPadding()() * 4), ::FX::FXint 
pr=(FX::FXWindow::defaultPadding()() * 4), ::FX::FXint 
pt=FX::FXWindow::defaultPadding( ), ::FX::FXint 
pb=FX::FXWindow::defaultPadding( ), ::FX::FXint sr=0 )
    : FX::FXPrimaryButton( parent, text, icon, tgt, sel, opts, x, y, 
w, h, pl, pr, pt, pb, sr )
      , bp::wrapper< FX::FXPrimaryButton >()
    {}

It should be:

    FXPrimaryButton_wrapper(::FX::FXComposite * parent, 
::FX::FXString const & text, ::FX::FXIcon * icon=0, ::FX::FXObject * 
tgt=0, ::FX::FXSelector sel=0, ::FX::FXuint 
opts=::FX::FXuint(::FX::PBUTTON_NORMAL), ::FX::FXint x=0, ::FX::FXint 
y=0, ::FX::FXint w=0, ::FX::FXint h=0, ::FX::FXint 
pl=(FX::FXWindow::defaultPadding() * 4), ::FX::FXint 
pr=(FX::FXWindow::defaultPadding() * 4), ::FX::FXint 
pt=FX::FXWindow::defaultPadding( ), ::FX::FXint 
pb=FX::FXWindow::defaultPadding( ), ::FX::FXint sr=0 )
    : FX::FXPrimaryButton( parent, text, icon, tgt, sel, opts, x, y, 
w, h, pl, pr, pt, pb, sr )
      , bp::wrapper< FX::FXPrimaryButton >()
    {}

Note the difference? FXWindow::defaultPadding() has an extra () after 
it. It seems pyplusplus only makes this mistake when it's an 
expression eg; when multiplied by 4 as above.

Cheers,
Niall





More information about the Cplusplus-sig mailing list