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

scx_lavd: use c_char consistently #246

Merged
merged 1 commit into from
Apr 27, 2024
Merged

scx_lavd: use c_char consistently #246

merged 1 commit into from
Apr 27, 2024

Commits on Apr 27, 2024

  1. scx_lavd: use c_char consistently

    In Rust c_char can be aliased to i8 or u8, depending on the particular
    target architecture.
    
    For example, trying to build scx_lavd on ppc64 triggers the following
    error:
    
    error[E0308]: mismatched types
       --> src/main.rs:200:38
        |
    200 |         let c_tx_cm: *const c_char = (&tx.comm as *const [i8; 17]) as *const i8;
        |                      -------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `*const u8`, found `*const i8`
        |                      |
        |                      expected due to this
        |
        = note: expected raw pointer `*const u8`
                   found raw pointer `*const i8`
    
    To fix this, consistently use c_char instead of assuming it corresponds
    to i8.
    
    Signed-off-by: Andrea Righi <[email protected]>
    Andrea Righi committed Apr 27, 2024
    Configuration menu
    Copy the full SHA
    905960f View commit details
    Browse the repository at this point in the history