rust3ds / ctru-rs

Rust wrapper for libctru
https://rust3ds.github.io/ctru-rs/
Other
116 stars 17 forks source link

Generate constants to match the types they're used as #166

Closed ian-h-chamberlain closed 3 months ago

ian-h-chamberlain commented 5 months ago

For a number of "macro constants", the bindings generate them using the c_int type, but they're actually intended for use as another type like u16 or something.

Might make sense for us to just generate this constant as a u16 via bindgen's ParseCallbacks::int_macro, to help prevent conversions.

In fact I wonder if we can't do this for a bunch of other constants and stop using as, maybe I'll file a separate issue for this more broadly

_Originally posted by @ian-h-chamberlain in https://github.com/rust3ds/ctru-rs/pull/156#discussion_r1501898908_