fix: compiler error for e2k CPU architecture

This commit is contained in:
sanua356 2026-07-23 21:15:43 +03:00 • committed by GitHub
parent dc0e80edd8
commit 5a6cd771d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,3 +1,5 @@
#![allow(unexpected_cfgs)]
use std::{ use std::{
fs, fs,
io::{BufRead, BufReader}, io::{BufRead, BufReader},
@ -144,7 +146,9 @@ pub fn get_x11_device_ids<W: Window>(window: &W) -> Option<(u16, u16)> {
{ {
let stat = let stat =
stat(Path::new("/dev/dri").join(device)).ok()?; stat(Path::new("/dev/dri").join(device)).ok()?;
let dev = stat.st_rdev; // Hack (u64 as u64) for E2K CPU architecture
#[allow(clippy::unnecessary_cast)]
let dev = stat.st_rdev as u64;
return super::ids_from_dev(dev); return super::ids_from_dev(dev);
} }
} }
@ -165,7 +169,9 @@ pub fn get_x11_device_ids<W: Window>(window: &W) -> Option<(u16, u16)> {
let dri3 = conn.dri3_open(root, x11rb::NONE).ok()?.reply().ok()?; let dri3 = conn.dri3_open(root, x11rb::NONE).ok()?.reply().ok()?;
let device_fd = dri3.device_fd; let device_fd = dri3.device_fd;
let stat = fstat(device_fd).ok()?; let stat = fstat(device_fd).ok()?;
let dev = stat.st_rdev; // Hack (u64 as u64) for E2K CPU architecture
#[allow(clippy::unnecessary_cast)]
let dev = stat.st_rdev as u64;
super::ids_from_dev(dev) super::ids_from_dev(dev)
} }
} }