[pygccxml-commit] SF.net SVN: pygccxml: [871] pyplusplus_dev/pyplusplus
Brought to you by:
mbaas,
roman_yakovenko
|
From: <rom...@us...> - 2007-01-19 19:51:51
|
Revision: 871
http://svn.sourceforge.net/pygccxml/?rev=871&view=rev
Author: roman_yakovenko
Date: 2007-01-19 11:51:51 -0800 (Fri, 19 Jan 2007)
Log Message:
-----------
adding new warnings for X** types in functions
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py
pyplusplus_dev/pyplusplus/messages/warnings_.py
Modified: pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py
===================================================================
--- pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2007-01-18 06:24:12 UTC (rev 870)
+++ pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2007-01-19 19:51:51 UTC (rev 871)
@@ -157,6 +157,13 @@
return self._exportable_impl_derived()
def _readme_impl( self ):
+ def is_double_ptr( type_ ):
+ #check for X**
+ if not declarations.is_pointer( type_ ):
+ return False
+ base = declarations.remove_pointer( type_ )
+ return declarations.is_pointer( base )
+
def suspicious_type( type_ ):
if not declarations.is_reference( type_ ):
return False
@@ -180,10 +187,15 @@
if suspicious_type( self.return_type ) and None is self.call_policies:
msgs.append( messages.W1008 )
+
+ if is_double_ptr( self.return_type ) and None is self.call_policies:
+ msgs.append( messages.W1050 % str(self.return_type) )
for index, arg in enumerate( self.arguments ):
if suspicious_type( arg.type ):
msgs.append( messages.W1009 % ( arg.name, index ) )
+ if is_double_ptr( arg.type ):
+ msgs.append( messages.W1051 % ( arg.name, index, str(arg.type) ) )
if False == self.overridable:
msgs.append( self._non_overridable_reason)
Modified: pyplusplus_dev/pyplusplus/messages/warnings_.py
===================================================================
--- pyplusplus_dev/pyplusplus/messages/warnings_.py 2007-01-18 06:24:12 UTC (rev 870)
+++ pyplusplus_dev/pyplusplus/messages/warnings_.py 2007-01-19 19:51:51 UTC (rev 871)
@@ -148,6 +148,14 @@
W1049 = 'This method could not be overriden in Python - method returns reference ' \
'to local variable!'
+W1050 = 'The function returns "%s" type. You have to specify a call policies.'
+
+
+W1051 = 'The function takes as argument (name=%s, pos=%d) "%s" type. ' \
+ 'You have to specify a call policies or to use "Function Transformation" ' \
+ 'functionality.'
+
+
warnings = globals()
for identifier, explanation in warnings.items():
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|