From 318ef2b81f43a1a722c9488a470b6fb7e91d763f Mon Sep 17 00:00:00 2001 From: Volker Mische Date: Wed, 28 Sep 2022 16:51:58 +0200 Subject: [PATCH] Fix: make UUID retrieval more portable The `CUuuid` byte type is `std::os::raw::c_char` and it depends on the platform, whether it is `i8` or `u8` in Rust. With just passing in `0` without a type identifier, both cases are handled. This makes the code more portable. --- crates/cust/src/device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cust/src/device.rs b/crates/cust/src/device.rs index e876fb5..54182cc 100644 --- a/crates/cust/src/device.rs +++ b/crates/cust/src/device.rs @@ -342,7 +342,7 @@ impl Device { /// # } /// ``` pub fn uuid(self) -> CudaResult<[u8; 16]> { - let mut cu_uuid = CUuuid { bytes: [0i8; 16] }; + let mut cu_uuid = CUuuid { bytes: [0; 16] }; unsafe { cuDeviceGetUuid(&mut cu_uuid, self.device).to_result()?; }