Revision: 710
http://svn.sourceforge.net/pygccxml/?rev=710&view=rev
Author: roman_yakovenko
Date: 2006-11-11 11:04:40 -0800 (Sat, 11 Nov 2006)
Log Message:
-----------
fixing the implementation to use type_traits functionality
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/function_transformers/transformers.py
Modified: pyplusplus_dev/pyplusplus/function_transformers/transformers.py
===================================================================
--- pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2006-11-11 19:01:31 UTC (rev 709)
+++ pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2006-11-11 19:04:40 UTC (rev 710)
@@ -52,8 +52,7 @@
# Do some sanity checking (whether the argument can actually be
# an output argument, i.e. it has to be a reference or a pointer)
reftype = arg.type
- if not (isinstance(reftype, declarations.reference_t) or
- isinstance(reftype, declarations.pointer_t)):
+ if not declarations.is_pointer( reftype ) and not declarations.is_reference( reftype ):
raise ValueError, '%s\nOutput variable %d ("%s") must be a reference or a pointer (got %s)'%(sm.decl, self.idx, arg.name, arg.type)
# Declare a local variable that will receive the output value
@@ -107,8 +106,7 @@
# Do some checks (the arg has to be a reference or a pointer)
reftype = arg.type
- if not (isinstance(reftype, declarations.reference_t) or
- isinstance(reftype, declarations.pointer_t)):
+ if not declarations.is_pointer( reftype ) and not declarations.is_reference( reftype ):
raise ValueError, '%s\nInput variable %d ("%s") must be a reference or a pointer (got %s)'%(sm.decl, self.idx, arg.name, arg.type)
# Create an equivalent argument that is not a reference type
@@ -144,8 +142,7 @@
# Do some checks (the arg has to be a reference or a pointer)
reftype = arg.type
- if not (isinstance(reftype, declarations.reference_t) or
- isinstance(reftype, declarations.pointer_t)):
+ if not declarations.is_pointer( reftype ) and not declarations.is_reference( reftype ):
raise ValueError, '%s\nInOut variable %d ("%s") must be a reference or a pointer (got %s)'%(sm.decl, self.idx, arg.name, arg.type)
# Create an equivalent argument that is not a reference type
@@ -214,8 +211,7 @@
# Remove the original argument...
arg = sm.remove_arg(self.idx)
- if not (isinstance(arg.type, declarations.pointer_t) or
- isinstance(arg.type, declarations.array_t)):
+ if not declarations.is_pointer( arg.type ) and not declarations.is_array( arg.type ):
raise ValueError, "%s\nArgument %d (%s) must be a pointer."%(sm.decl, self.idx, arg.name)
# Declare a variable that will hold the Python list
@@ -297,8 +293,7 @@
# Remove the original argument...
arg = sm.remove_arg(self.idx)
- if not (isinstance(arg.type, declarations.pointer_t) or
- isinstance(arg.type, declarations.array_t)):
+ if not declarations.is_pointer( arg.type ) and not declarations.is_array( arg.type ):
raise ValueError, "%s\nArgument %d (%s) must be a pointer."%(sm.decl, self.idx, arg.name)
self.argname = arg.name
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|