Commit a8f0a5b
committed
lexer.c: fix initialize function signature
Fix initialize function signature for Ruby 3.x compatibility where the
arity checks are enforced. This is done by removing unused input_text
parameter to match arity 0 declaration.
Fixes:
```
In file included from /usr/local/include/ruby-3.1.0/ruby/ruby.h:26,
from /usr/local/include/ruby-3.1.0/ruby.h:38,
from ../../../../ext/ios_parser/c_lexer/lexer.c:1:
../../../../ext/ios_parser/c_lexer/lexer.c: In function 'Init_c_lexer':
/usr/local/include/ruby-3.1.0/ruby/internal/anyargs.h:287:135: error: passing argument 3 of 'rb_define_method_00' from incompatible pointer type [-Wincompatible-pointer-types]
287 | , mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_method((arity), (func))((klass), (mid), (func), (arity))
| ^~~~~~
| |
| VALUE (*)(VALUE, VALUE) {aka long unsigned int (*)(long unsigned int, long unsigned int)}
../../../../ext/ios_parser/c_lexer/lexer.c:610:5: note: in expansion of macro 'rb_define_method'
610 | rb_define_method(rb_cCLexer, "initialize", initialize, 0);
/usr/local/include/ruby-3.1.0/ruby/internal/anyargs.h:276:21: note: expected 'VALUE (*)(VALUE)' {aka 'long unsigned int (*)(long unsigned int)'} but argument is of type 'VALUE (*)(VALUE, VALUE)' {aka 'long unsigned int (*)(long unsigned int, long unsigned int)'}
276 | RBIMPL_ANYARGS_DECL(rb_define_method, VALUE, const char *)
| ^~~~~~~~~~~~~~~~
/usr/local/include/ruby-3.1.0/ruby/internal/anyargs.h:254:41: note: in definition of macro 'RBIMPL_ANYARGS_DECL'
254 | RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _00(__VA_ARGS__, VALUE(*)(VALUE), int); \
| ^~~
At top level: | ^~~~~~~~~~~~~~~~
```1 parent 6d7477b commit a8f0a5b
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
0 commit comments