@@ -47,8 +47,7 @@ def remove_c_comments(code):
47
47
48
48
49
49
def collect_function_args ():
50
- """ Get a dict that maps function-names to another dict that maps arg-names to c-arg strings.
51
- """
50
+ """Get a dict that maps function-names to another dict that maps arg-names to c-arg strings."""
52
51
53
52
funcs = {}
54
53
@@ -75,8 +74,7 @@ def collect_function_args():
75
74
76
75
77
76
def collect_structs ():
78
- """ Get a dict that maps struct names to another dict that maps field-names to c-type string.
79
- """
77
+ """Get a dict that maps struct names to another dict that maps field-names to c-type string."""
80
78
81
79
structs = {}
82
80
@@ -117,8 +115,7 @@ def collect_structs():
117
115
118
116
119
117
def check_rust_wrapper_args ():
120
- """ Test that the wrappers use pointers where the c-header specifies pointers.
121
- """
118
+ """Test that the wrappers use pointers where the c-header specifies pointers."""
122
119
123
120
funcs = collect_function_args ()
124
121
@@ -141,7 +138,7 @@ def check_rust_wrapper_args():
141
138
print (f"In { funcname } :" )
142
139
i1 = text .find ("(" , i0 )
143
140
i2 = text .find (")" , i1 )
144
- args = " " .join (text [i1 + 1 : i2 ].split ())
141
+ args = " " .join (text [i1 + 1 : i2 ].split ())
145
142
args = [arg .strip () for arg in args .split ("," )]
146
143
covered = set ()
147
144
for arg in args :
@@ -157,7 +154,7 @@ def check_rust_wrapper_args():
157
154
print (message )
158
155
if not ok :
159
156
fails .append (message )
160
- #print(f" {status} {argname}: {typ}\n {' '*len(argname)}{c_arg}")
157
+ # print(f" {status} {argname}: {typ}\n {' '*len(argname)}{c_arg}")
161
158
missing = set (funcs [funcname ]).difference (covered )
162
159
if missing :
163
160
message = f"{ funcname } has missing args: { missing } "
@@ -168,8 +165,7 @@ def check_rust_wrapper_args():
168
165
169
166
170
167
def check_overloaded_structs ():
171
- """ Check that the overloaded structs in build.rs have fields that match the headers.
172
- """
168
+ """Check that the overloaded structs in build.rs have fields that match the headers."""
173
169
174
170
structs = collect_structs ()
175
171
@@ -216,7 +212,6 @@ def check_overloaded_structs():
216
212
217
213
218
214
def main ():
219
-
220
215
fails = []
221
216
fails += check_rust_wrapper_args ()
222
217
fails += check_overloaded_structs ()
0 commit comments