dash-recipes icon indicating copy to clipboard operation
dash-recipes copied to clipboard

i8 u8 tomato tomato?

Open pietervandermeer opened this issue 4 years ago • 1 comments

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"

pietervandermeer avatar Nov 23 '20 20:11 pietervandermeer

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!

snuk182 avatar Nov 27 '20 14:11 snuk182