Verified Commit f666e52e authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Preparation for Redox as part of the unix target family

parent 614e6cbd
Pipeline #3932 passed with stage
in 1 minute and 49 seconds
......@@ -19,7 +19,7 @@ use std::{
io::{self, Read, Write},
iter,
mem,
os::unix::io::{AsRawFd, FromRawFd},
os::unix::io::{AsRawFd, FromRawFd, RawFd},
path::PathBuf,
rc::Rc,
slice,
......@@ -155,7 +155,7 @@ impl Orbital {
pub fn open_display(display_path: &str) -> io::Result<Self> {
let display = syscall::open(&display_path, O_CLOEXEC | O_NONBLOCK | O_RDWR)
.map(|socket| {
unsafe { File::from_raw_fd(socket) }
unsafe { File::from_raw_fd(socket as RawFd) }
})
.map_err(|err| {
eprintln!("orbital: failed to open display {}: {}", display_path, err);
......@@ -164,7 +164,7 @@ impl Orbital {
let scheme = syscall::open(":orbital", O_CREAT | O_CLOEXEC | O_NONBLOCK | O_RDWR)
.map(|socket| {
unsafe { File::from_raw_fd(socket) }
unsafe { File::from_raw_fd(socket as RawFd) }
})
.map_err(|err| {
eprintln!("orbital: failed to create :orbital: {}", err);
......@@ -172,13 +172,13 @@ impl Orbital {
})?;
let mut buf: [u8; 4096] = [0; 4096];
let count = syscall::fpath(display.as_raw_fd(), &mut buf).unwrap();
let count = syscall::fpath(display.as_raw_fd() as usize, &mut buf).unwrap();
let path = unsafe { String::from_utf8_unchecked(Vec::from(&buf[..count])) };
let res = path.split(":").nth(1).unwrap_or("");
let width = res.split("/").nth(1).unwrap_or("").parse::<i32>().unwrap_or(0);
let height = res.split("/").nth(2).unwrap_or("").parse::<i32>().unwrap_or(0);
let image = unsafe { display_fd_map(width, height, display.as_raw_fd()) };
let image = unsafe { display_fd_map(width, height, display.as_raw_fd() as usize) };
Ok(Orbital {
scheme: scheme,
......
......@@ -365,7 +365,6 @@ impl<'a> OrbitalSchemeEvent<'a> {
/// Draws a list of currently open windows in the middle of the screen
fn draw_window_list(&mut self) {
use orbfont;
let mut rendered_text: Vec<orbfont::Text> = vec![];
for id in self.scheme.order.iter() {
if let Some(window) = self.scheme.windows.get(&id) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment