Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51655 - sandbox/numeric_bindings/libs/numeric/bindings/tools
From: rutger_at_[hidden]
Date: 2009-03-09 03:34:12


Author: rutger
Date: 2009-03-09 03:34:11 EDT (Mon, 09 Mar 2009)
New Revision: 51655
URL: http://svn.boost.org/trac/boost/changeset/51655

Log:
Removal of static asserts if not used in generated bindings.

Text files modified:
   sandbox/numeric_bindings/libs/numeric/bindings/tools/blas_generator.py | 8 ++++++--
   sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py | 7 +++++--
   2 files changed, 11 insertions(+), 4 deletions(-)

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/blas_generator.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/blas_generator.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/blas_generator.py 2009-03-09 03:34:11 EDT (Mon, 09 Mar 2009)
@@ -153,15 +153,19 @@
       level1_template = level1_template.replace( "$LEVEL1", ", ".join( level1_arg_list ) )
       level1_template = level1_template.replace( "$TYPES", ", ".join( level1_type_arg_list ) )
       level1_template = level1_template.replace( "$ASSERTS", "\n ".join( level1_assert_list ) )
- level1_template = level1_template.replace( "$STATIC_ASSERTS", "\n ".join( level1_static_assert_list ) )
       level1_template = level1_template.replace( '$RETURN_TYPE', info_map[ subroutine ][ 'level1_return_type' ] )
       level1_template = level1_template.replace( '$RETURN_STATEMENT', info_map[ subroutine ][ 'return_statement' ] )
 
+ if len( level1_static_assert_list ) > 0:
+ level1_template = level1_template.replace( "$STATIC_ASSERTS", "\n ".join( level1_static_assert_list ) )
+ else:
+ level1_template = level1_template.replace( "\n $STATIC_ASSERTS", "" )
+
       # Level 2 replacements
       # some special stuff is done here, such as replacing real_type with a
       # type-traits deduction, etc..
       level2_template = level2_template.replace( "$LEVEL2", ", ".join( level2_arg_list ) )
-
+
       if len(level1_type_arg_list)>0:
         first_typename = level1_type_arg_list[0].split(" ")[-1]
         first_typename_datatype = first_typename[0:6].lower() # 'matrix' or 'vector'

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py 2009-03-09 03:34:11 EDT (Mon, 09 Mar 2009)
@@ -187,8 +187,11 @@
       level1_template = level1_template.replace( "$LEVEL1", ", ".join( level1_arg_list ) )
       level1_template = level1_template.replace( "$TYPES", ", ".join( level1_type_arg_list ) )
       level1_template = level1_template.replace( "$ASSERTS", "\n ".join( level1_assert_list ) )
- level1_template = level1_template.replace( "$STATIC_ASSERTS", "\n ".join( level1_static_assert_list ) )
-
+
+ if len( level1_static_assert_list ) > 0:
+ level1_template = level1_template.replace( "$STATIC_ASSERTS", "\n ".join( level1_static_assert_list ) )
+ else:
+ level1_template = level1_template.replace( "\n $STATIC_ASSERTS", "" )
 
       if len( user_defined_arg_list ) > 0:
         level1_template = level1_template.replace( "$INIT_USER_DEFINED_VARIABLES", indent_lines( "\n".join(user_defined_arg_list), 8 ) )


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk