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

i8 u8 tomato tomato? #34

Open
pietervandermeer opened this issue Nov 23, 2020 · 1 comment
Open

i8 u8 tomato tomato? #34

pietervandermeer opened this issue Nov 23, 2020 · 1 comment

Comments

@pietervandermeer
Copy link

Got this puppy running on my old Macbook and it works like a charm! Muchas gracias! But moving over to Raspberry Pi4, there seems to be many i8 u8 type problems. The nk_ functions seem to want u8, but get i8..

error[E0308]: mismatched types
    --> /root/.cargo/registry/src/github.com-1285ae84e5963aae/nuklear-rust-0.6.3/src/lib.rs:3352:50
     |
3352 |             nk_textedit_text(&mut self.internal, arg2.as_ptr() as *const i8, arg2.as_bytes().len() as ::std::os::raw::c_int);
     |                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
     |
     = note: expected raw pointer `*const u8`
                found raw pointer `*const i8`

error[E0308]: mismatched types
    --> /root/.cargo/registry/src/github.com-1285ae84e5963aae/nuklear-rust-0.6.3/src/lib.rs:3379:56
     |
3379 |         unsafe { nk_textedit_paste(&mut self.internal, arg2.as_ptr() as *const i8, arg2.as_bytes().len() as ::std::os::raw::c_int) != 0 }
     |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
     |
     = note: expected raw pointer `*const u8`
                found raw pointer `*const i8`

Is this easily fixed?

My Cargo.toml has the following deps:

nuklear-rust = {version = "~0.6"}
nuklear-backend-gfx = "~0.9"
gfx_device_gl = "~0.16"
gfx_window_glutin = "~0.30"
gfx = "~0.18"
glutin = "~0.20"
image = "~0.12"
@snuk182
Copy link
Owner

snuk182 commented Nov 27, 2020

Hi, thanks for the input!

Meh... unfortunately I cannot say a meaningful thing regarding an easy fix for the type mismatch problem. Perhaps forking the project with changing the necessary type at that method passes as a workaround. Also I'm ATM buried with my main work, so cannot pay much attention to the project, but pull requests are always welcome!

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

No branches or pull requests

2 participants