From 65f8fa3cf79cb76e3bf08a8c1821c7dd6dcbb2ef Mon Sep 17 00:00:00 2001 From: liffy <629075+lifning@users.noreply.github.com> Date: Tue, 11 Mar 2025 14:14:52 -0700 Subject: [PATCH] [SC64][SW] Fix invalid variable type (`description`/`serial`) for libftdi functions in sc64deployer (#105) `c_char` isn't `i8` on all architectures (e.g. on ARM it's `u8`) Co-authored-by: lif <> Co-authored-by: Mateusz Faderewski --- sw/deployer/src/sc64/ftdi.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sw/deployer/src/sc64/ftdi.rs b/sw/deployer/src/sc64/ftdi.rs index 4a7db96..76cfd5a 100644 --- a/sw/deployer/src/sc64/ftdi.rs +++ b/sw/deployer/src/sc64/ftdi.rs @@ -1,3 +1,5 @@ +use std::ffi::c_char; + pub struct DeviceInfo { pub description: String, pub serial: String, @@ -73,8 +75,8 @@ impl Wrapper { let result = if devices > 0 { let mut list: Vec = vec![]; - let mut description = [0i8; 128]; - let mut serial = [0i8; 128]; + let mut description = [c_char::from(0); 128]; + let mut serial = [c_char::from(0); 128]; let mut device = device_list; let mut index = 0;