Commit graph

5 commits

Author SHA1 Message Date
Satoshi Tagomori
294b52fb9b Follow the code style about else 2025-05-11 23:32:50 +09:00
Satoshi Tagomori
ff790c759e Compact prime classext readable/writable flags
To make RClass size smaller, move flags of prime classext readable/writable to:
 readable - use ns_classext_tbl is NULL or not (if NULL, it's readable)
 writable - use FL_USER2 of RBasic flags
2025-05-11 23:32:50 +09:00
Yusuke Endoh
4b33b468ac Fix function pointer type mismatch with rb_define_private_method
`rb_define_private_method` performs strict type checking on the function
pointer. As a result, we cannot pass the function a generic signature.

```
  /github/workspace/src/namespace.c:1097:72: note: expected 'VALUE (*)(void)' {aka 'long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(int,  VALUE *, VALUE)' {aka 'long unsigned int (*)(int,  long unsigned int *, long unsigned int)'}
   1097 | namespace_define_loader_method(VALUE module, const char *name, VALUE (*func)(ANYARGS), int argc)
        |                                                                ~~~~~~~~^~~~~~~~~~~~~~
```

This commit defines the method directly to avoid the mismatch error.
2025-05-11 23:32:50 +09:00
Yusuke Endoh
1e4f7a28b8 Fix "old-style function definition"
```
namespace.c: In function ‘rb_namespace_available’:
namespace.c:55:1: warning: old-style function definition [-Wold-style-definition]
   55 | rb_namespace_available()
      | ^~~~~~~~~~~~~~~~~~~~~~
```
2025-05-11 23:32:50 +09:00
Satoshi Tagomori
382645d440 namespace on read 2025-05-11 23:32:50 +09:00