[pygccxml-commit] source/pyplusplus/code_creators calldef.py,1.48,1.49
Brought to you by:
mbaas,
roman_yakovenko
From: Matthias B. <mb...@us...> - 2006-03-23 08:52:21
|
Update of /cvsroot/pygccxml/source/pyplusplus/code_creators In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23447 Modified Files: calldef.py Log Message: Applied the patch that Roman posted to the mailing list (so that a default value of 0 on pointer arguments is actually taken into account) Index: calldef.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/calldef.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** calldef.py 20 Mar 2006 05:47:56 -0000 1.48 --- calldef.py 23 Mar 2006 08:52:14 -0000 1.49 *************** *** 50,61 **** def _keywords_args(self): result = ['( '] for arg in self.declaration.arguments: if 1 < len( result ): result.append( self._PARAM_SEPARATOR ) ! result.append( algorithm.create_identifier( self, '::boost::python::arg' ) ) result.append( '("%s")' % arg.name ) if self.use_default_arguments and arg.default_value: ! result.append( '=%s' % arg.default_value ) result.append( ' )' ) return ''.join( result ) --- 50,66 ---- def _keywords_args(self): + boost_arg = algorithm.create_identifier( self, '::boost::python::arg' ) + boost_obj = algorithm.create_identifier( self, '::boost::python::object' ) result = ['( '] for arg in self.declaration.arguments: if 1 < len( result ): result.append( self._PARAM_SEPARATOR ) ! result.append( boost_arg ) result.append( '("%s")' % arg.name ) if self.use_default_arguments and arg.default_value: ! if not declarations.is_pointer( arg.type ) or arg.default_value != '0': ! result.append( '=%s' % arg.default_value ) ! else: ! result.append( '=%s()' % boost_obj ) result.append( ' )' ) return ''.join( result ) *************** *** 477,491 **** def _keywords_args(self): if not self.declaration.arguments: ! return '' result = ['( '] for arg in self.declaration.arguments: if 1 < len( result ): result.append( ', ' ) ! result.append( algorithm.create_identifier( self, '::boost::python::arg' ) ) result.append( '("%s")' % arg.name ) if self.use_default_arguments and arg.default_value: ! result.append( '=%s' % arg.default_value ) result.append( ' )' ) ! return ''.join( result ) def _create_arg_code( self, arg ): --- 482,501 ---- def _keywords_args(self): if not self.declaration.arguments: ! return '' ! boost_arg = algorithm.create_identifier( self, '::boost::python::arg' ) ! boost_obj = algorithm.create_identifier( self, '::boost::python::object' ) result = ['( '] for arg in self.declaration.arguments: if 1 < len( result ): result.append( ', ' ) ! result.append( boost_arg ) result.append( '("%s")' % arg.name ) if self.use_default_arguments and arg.default_value: ! if not declarations.is_pointer( arg.type ) or arg.default_value != '0': ! result.append( '=%s' % arg.default_value ) ! else: ! result.append( '=%s()' % boost_obj ) result.append( ' )' ) ! return ''.join( result ) def _create_arg_code( self, arg ): *************** *** 849,850 **** --- 859,863 ---- , [ from_arg , to_arg ] ) \ + '();' + + + |