Revision: 560
http://python-ogre.svn.sourceforge.net/python-ogre/?rev=560&view=rev
Author: andy_miller
Date: 2008-01-29 18:02:12 -0800 (Tue, 29 Jan 2008)
Log Message:
-----------
Fix to the Automatice Function transformation code as it wasn't picking up constant void pointers
This fixes PixelUtil::unpackColour and a number of other functions
Modified Paths:
--------------
trunk/python-ogre/code_generators/common_utils/__init__.py
trunk/python-ogre/code_generators/ogre/generate_code.py
Modified: trunk/python-ogre/code_generators/common_utils/__init__.py
===================================================================
--- trunk/python-ogre/code_generators/common_utils/__init__.py 2008-01-30 00:14:01 UTC (rev 559)
+++ trunk/python-ogre/code_generators/common_utils/__init__.py 2008-01-30 02:02:12 UTC (rev 560)
@@ -203,22 +203,29 @@
arg_position = 0
trans=[]
desc=""
+# print "Checking", fun.decl_string
for arg in fun.arguments:
rawarg = declarations.remove_declarated(
declarations.remove_const(
declarations.remove_reference(
declarations.remove_pointer ( arg.type ))))
- print arg.type.decl_string
+
+# print fun.name, arg.type.decl_string, rawarg
+
+ ## now check if the arg is a fundemental type (int float etc), a void
+ ## or a special ..
if declarations.is_arithmetic (rawarg)\
- or declarations.is_void_pointer(arg.type)\
+ or declarations.is_void(rawarg)\
or arg.type.decl_string in special_vars:
# print "Auto:", arg.type.decl_string," is_integral|floating|void|special|"
if declarations.is_pointer(arg.type): #we convert any pointers to unsigned int's
+# print "Pointer"
trans.append( ft.modify_type(arg_position,_ReturnUnsignedInt ) )
desc = desc +"Argument: "+arg.name+ "( pos:" + str(arg_position) + " - " +\
arg.type.decl_string + " ) takes a CTypes.addressof(xx). \\n"
# print fullname,"Ctype Mod for ", arg.name, arg.type.decl_string
elif declarations.is_reference(arg.type):
+# print "Ref"
matched = False
for pre in prefix_output: # functions whose name starts in the list are consider output only
if fun.name.startswith (pre):
@@ -232,6 +239,12 @@
desc = desc + "Argument: "+arg.name+ "( pos:" + str(arg_position) + " - " +\
arg.type.decl_string + " ) converted to an input/output (change to return types).\\n"
# print fullname," ft.inout ", arg.name, arg.type.decl_string
+ else:
+ pass
+# print "Not Handled"
+ else:
+ pass
+# print "Not valid to process"
arg_position += 1
if trans:
if fun.documentation: # it's already be tweaked:
Modified: trunk/python-ogre/code_generators/ogre/generate_code.py
===================================================================
--- trunk/python-ogre/code_generators/ogre/generate_code.py 2008-01-30 00:14:01 UTC (rev 559)
+++ trunk/python-ogre/code_generators/ogre/generate_code.py 2008-01-30 02:02:12 UTC (rev 560)
@@ -642,12 +642,16 @@
# now we fix up the smart pointers ...
Set_Smart_Pointers ( main_ns )
- # Functions that have void pointers in their argument list need to change to unsigned int's
- pointee_types=['unsigned int','int', 'float', '::Ogre::Real', '::Ogre::uchar', '::Ogre::uint8', '::Ogre::uint16'
- 'unsigned char', 'char', 'bool']
- ignore_names=['Matrices', 'Vertices', 'ExceptionFactory', 'UTFString' ]
+ ### This is now handled by Auto_Funtional_Transformation...
+
+# # # # Functions that have void pointers in their argument list need to change to unsigned int's
+# # # pointee_types=['unsigned int','int', 'float', '::Ogre::Real', '::Ogre::uchar', '::Ogre::uint8', '::Ogre::uint16'
+# # # 'unsigned char', 'char', 'bool']
+# # # ignore_names=['Matrices', 'Vertices', 'ExceptionFactory', 'UTFString' ]
# # # common_utils.Fix_Void_Ptr_Args ( main_ns, pointee_types, ignore_names )
+
+
# and change functions that return a variety of pointers to instead return unsigned int's
pointee_types=['unsigned int','int', 'float', '::Ogre::Real', '::Ogre::uchar', '::Ogre::uint8', 'unsigned char', 'char']
ignore_names=['ptr', 'useCountPointer'] # these are function names we know it's cool to exclude
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|