@@ -11,7 +11,7 @@ class default_argument_patcher_t( object ):
1111 def __init__ ( self , enums ):
1212 object .__init__ ( self )
1313 self .__enums = enums
14-
14+
1515 def __call__ (self , decl ):
1616 for arg in decl .arguments :
1717 if not arg .default_value :
@@ -26,7 +26,7 @@ def __find_fixer(self, func, arg):
2626 elif self .__is_unqualified_enum ( func , arg ):
2727 return self .__fix_unqualified_enum
2828 elif self .__is_double_call ( func , arg ):
29- return self .__fix_double_call
29+ return self .__fix_double_call
3030 elif self .__is_invalid_integral ( func , arg ):
3131 return self .__fix_invalid_integral
3232 elif self .__is_constructor_call ( func , arg ):
@@ -39,9 +39,9 @@ def __join_names( self, prefix, suffix ):
3939 return '::' + suffix
4040 else :
4141 return prefix + '::' + suffix
42-
42+
4343 def __is_unqualified_enum (self , func , arg ):
44- type_ = declarations .remove_reference ( declarations .remove_cv ( arg .type ) )
44+ type_ = declarations .remove_reference ( declarations .remove_cv ( arg .type ) )
4545 if not declarations .is_enum ( type_ ):
4646 return False
4747 enum_type = declarations .enum_declaration ( type_ )
@@ -53,7 +53,7 @@ def __fix_unqualified_enum( self, func, arg):
5353 return self .__join_names ( enum_type .parent .decl_string , arg .default_value )
5454
5555 def __is_invalid_integral (self , func , arg ):
56- type_ = declarations .remove_reference ( declarations .remove_cv ( arg .type ) )
56+ type_ = declarations .remove_reference ( declarations .remove_cv ( arg .type ) )
5757 if not declarations .is_integral ( type_ ):
5858 return False
5959 try :
@@ -68,7 +68,7 @@ def __fix_invalid_integral(self, func, arg):
6868 return arg .default_value
6969 except :
7070 pass
71-
71+
7272 try :
7373 int ( arg .default_value , 16 )
7474 if 64 == utils .get_architecture ():
@@ -83,7 +83,7 @@ def __fix_invalid_integral(self, func, arg):
8383 return '0x' + default_value
8484 except :
8585 pass
86-
86+
8787 #may be we deal with enum
8888 parent = func .parent
8989 while parent :
@@ -103,7 +103,7 @@ def __find_enum( self, scope, default_value ):
103103 #this algorithm could be improved: it could take into account
104104 #1. unnamed namespaced
105105 #2. location within files
106-
106+
107107 for enum in self .__enums :
108108 if enum .parent is scope and enum .has_value_name ( default_value ):
109109 return enum
@@ -121,7 +121,7 @@ def __is_double_call( self, func, arg ):
121121 args1 = call_invocation .args ( dv [ found1 [0 ] : found1 [1 ] + 1 ] )
122122 args2 = call_invocation .args ( dv [ found2 [0 ] : found2 [1 ] + 1 ] )
123123 return len (args1 ) == len (args2 )
124-
124+
125125 def __fix_double_call ( self , func , arg ):
126126 call_invocation = declarations .call_invocation
127127 dv = arg .default_value
@@ -167,7 +167,7 @@ def __fix_constructor_call( self, func, arg ):
167167 , decl .name )
168168 else :
169169 f_q_name = self .__join_names ( declarations .full_name ( decl .parent ), name )
170-
170+
171171 return call_invocation .join ( f_q_name , args )
172172
173173class casting_operator_patcher_t ( object ):
@@ -186,9 +186,3 @@ def fix_calldef_decls(decls, enums):
186186 default_arg_patcher ( decl )
187187 if isinstance ( decl , declarations .casting_operator_t ):
188188 _casting_oper_patcher_ ( decl )
189-
190- def fix_mangled ( decls ):
191- suffix = ' *INTERNAL* '
192- for d in decls :
193- if d .mangled and d .mangled .endswith ( suffix ):
194- d .mangled = d .mangled [:- len ( suffix )]
0 commit comments