Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatched types when compiling for arm #22

Closed
AnyTimeTraveler opened this issue Feb 8, 2021 · 4 comments · Fixed by #23
Closed

Mismatched types when compiling for arm #22

AnyTimeTraveler opened this issue Feb 8, 2021 · 4 comments · Fixed by #23

Comments

@AnyTimeTraveler
Copy link
Contributor

When compiling for armv7-unknown-linux-musleabihf, I get two errors like below:

error[E0308]: mismatched types
   --> /cargo/registry/src/github.com-1ecc6299db9ec823/evdev-0.10.2/src/raw.rs:216:47 nix, num-bigint                                                                                                                                
    |
216 |     convert_ioctl_res!(::nix::libc::ioctl(fd, ior!(b'E', 0x20 + ev, len) as ::libc::c_ulong, buf))
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
    |
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
    |
216 |     convert_ioctl_res!(::nix::libc::ioctl(fd, (ior!(b'E', 0x20 + ev, len) as ::libc::c_ulong).try_into().unwrap(), buf))
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@jeff-hiner
Copy link
Collaborator

This fix broke aarch64 on my end:

error[E0308]: mismatched types
   --> src/raw.rs:216:47
    |
216 |     convert_ioctl_res!(::nix::libc::ioctl(fd, request_code_read!(b'E', 0x20 + ev, len) as ::libc::c_ulong, buf))
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u64`
    |
help: you can convert a `u64` to an `i32` and panic if the converted value doesn't fit
    |
216 |     convert_ioctl_res!(::nix::libc::ioctl(fd, (request_code_read!(b'E', 0x20 + ev, len) as ::libc::c_ulong).try_into().unwrap(), buf))
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
   --> src/raw.rs:226:47
    |
226 | ...(fd, request_code_read!(b'E', 0x40 + abs, ::std::mem::size_of::<input_absinfo>()) as ::libc::c_ulong, buf))
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u64`
    |
help: you can convert a `u64` to an `i32` and panic if the converted value doesn't fit
    |
226 |     convert_ioctl_res!(::nix::libc::ioctl(fd, (request_code_read!(b'E', 0x40 + abs, ::std::mem::size_of::<input_absinfo>()) as ::libc::c_ulong).try_into().unwrap(), buf))
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@rlingineni
Copy link

Running into this as well! Trying to use with libremarkable

@AnyTimeTraveler
Copy link
Contributor Author

AnyTimeTraveler commented Mar 18, 2021

Running into this as well! Trying to use with libremarkable

Yeah, that's why I initially submitted the fix.
I didn't use libremarkable but evdev directly to only read the input of the Wacom Pen.
I am hoping that this could go into a release soon, so that I can stop using my local patch.

Is there anything I can help with, on the way to the next release?

@coolreader18
Copy link
Collaborator

@AnyTimeTraveler do you have a branch you could make a PR for? It would probably be fine to have a single version that just casts as _ so it works no matter the specific int type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants