raymanfx / libv4l-rs

Video4Linux2 bindings for Rust
MIT License
145 stars 62 forks source link

Switch v4l2_ext_control string union cast to os::raw::c_char #46

Closed fdlg closed 2 years ago

fdlg commented 2 years ago

Switch v4l2_ext_control string union cast to os::raw::c_char instead of i8 to match type used by bindgen generated code

For some targets, like armv7-unknown-linux-gnueabihf, the os c_char type is u8 and casting to i8 resulting in the following compilation error:

error[E0308]: mismatched types
   --> src/device.rs:269:59
    |
269 |                         control.__bindgen_anon_1.string = val.as_ptr() as *mut i8;
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
    |
    = note: expected raw pointer `*mut u8`
               found raw pointer `*mut i8`
MarijnS95 commented 2 years ago

It doesn't seem like anyone still maintains this repo. I submitted the same change in https://github.com/raymanfx/libv4l-rs/pull/43 and it has yet to be merged.

fdlg commented 2 years ago

Ha, looks like I should have taken a closer look a the open PRs

raymanfx commented 2 years ago

Sorry - for some reason I did not receive any E-Mail notifications for this repo anymore. Thanks for the PRs!

MarijnS95 commented 2 years ago

@raymanfx Thanks for showing up and merging everything though :heart: !

Ha, GH turned this merge into an empty commit though after #43 :)