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

atom: tests: Don't assume char signedness #115

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

andhe
Copy link

@andhe andhe commented Dec 14, 2023

For example on aarch64/arm64:

error[E0308]: mismatched types
  --> tests/atom_integration.rs:91:14
   |
91 |         URI: LV2Map::URI.as_ptr() as *const i8,
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `*const u8`, found `*const i8`
   |
   = note: expected raw pointer `*const u8`
              found raw pointer `*const i8`

error[E0308]: mismatched types
   --> tests/atom_integration.rs:144:13
    |
141 |         let plugin = (plugin_descriptor.instantiate.unwrap())(
    |                      ---------------------------------------- arguments to this function are incorrect
...
144 |             b"\0".as_ptr() as *const i8,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `*const u8`, found `*const i8`
    |
    = note: expected raw pointer `*const u8`
               found raw pointer `*const i8`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `lv2-atom` due to 2 previous errors

For example on aarch64/arm64:

```
error[E0308]: mismatched types
  --> tests/atom_integration.rs:91:14
   |
91 |         URI: LV2Map::URI.as_ptr() as *const i8,
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `*const u8`, found `*const i8`
   |
   = note: expected raw pointer `*const u8`
              found raw pointer `*const i8`

error[E0308]: mismatched types
   --> tests/atom_integration.rs:144:13
    |
141 |         let plugin = (plugin_descriptor.instantiate.unwrap())(
    |                      ---------------------------------------- arguments to this function are incorrect
...
144 |             b"\0".as_ptr() as *const i8,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `*const u8`, found `*const i8`
    |
    = note: expected raw pointer `*const u8`
               found raw pointer `*const i8`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `lv2-atom` due to 2 previous errors
```
@PieterPenninckx
Copy link
Contributor

This looks good to me: the field URI of the struct LV2_Feature has type *const c_char, but we're passing a *const i8. On machines where c_char is defined as i8, this will work, but on other machines it will not. As far as I understand, this pull request will resolve that issue.

I don't have merging powers, but I have no objections against approving this PR.

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 this pull request may close these issues.

None yet

2 participants