Skip to content

Use c_char instead of i8 for callback #3

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

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

Conversation

Xeonacid
Copy link

@Xeonacid Xeonacid commented Feb 9, 2025

c_char is unsigned on platforms like aarch64 and riscv64. Forcing i8 results in a compile error at slice::from_raw_parts_mut [1].

Tested with cargo run --bin sixel --features image -- ./assets/Ada.png

[1]

slice::from_raw_parts_mut(if data.is_null() { return 1 } else { data }, size as usize);

c_char is unsigned on platforms like aarch64 and riscv64.
Forcing i8 results in a compile error at `slice::from_raw_parts_mut` [1].

Tested with `cargo run --bin sixel --features image -- ./assets/Ada.png`

[1] https://github.com/benjajaja/sixel-bytes/blob/b41fda544a6ade744c9e6f98f1fa9ff876d048f4/src/lib.rs#L159
orhun pushed a commit to orhun/sixel-rs that referenced this pull request Feb 13, 2025
Same as sixel-bytes PR #3 [0].

c_char is unsigned on platforms like aarch64 and riscv64. Forcing i8 results in a compile error at `slice::from_raw_parts_mut` [1].

Tested with presenterm [2] on both x86_64 and riscv64.

[0] benjajaja/sixel-bytes#3
[1] https://github.com/benjajaja/sixel-bytes/blob/b41fda544a6ade744c9e6f98f1fa9ff876d048f4/src/lib.rs#L159
[2] https://gitlab.archlinux.org/archlinux/packaging/packages/presenterm/-/blob/main/PKGBUILD
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.

1 participant