Fix compilation of graphical_debug feature and remove live feature warnings.

parent ee5c43ed
use core::alloc::{Alloc, GlobalAlloc, Layout};
use core::alloc::{GlobalAlloc, Layout};
use core::{cmp, slice};
use super::FONT;
......@@ -15,7 +15,7 @@ pub struct Display {
impl Display {
pub fn new(width: usize, height: usize, onscreen: usize) -> Display {
let size = width * height;
let offscreen = unsafe { ::ALLOCATOR.alloc(Layout::from_size_align_unchecked(size * 4, 4096)).unwrap() };
let offscreen = unsafe { ::ALLOCATOR.alloc(Layout::from_size_align_unchecked(size * 4, 4096)) };
unsafe { fast_set64(offscreen as *mut u64, 0, size/2) };
Display {
width: width,
......
......@@ -66,7 +66,7 @@ impl Scheme for DiskScheme {
fn read(&self, id: usize, buffer: &mut [u8]) -> Result<usize> {
let mut handles = self.handles.write();
let mut handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
let handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
let data = handle.data.read();
let mut i = 0;
......@@ -81,7 +81,7 @@ impl Scheme for DiskScheme {
fn write(&self, id: usize, buffer: &[u8]) -> Result<usize> {
let mut handles = self.handles.write();
let mut handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
let handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
let mut data = handle.data.write();
let mut i = 0;
......@@ -96,7 +96,7 @@ impl Scheme for DiskScheme {
fn seek(&self, id: usize, pos: usize, whence: usize) -> Result<usize> {
let mut handles = self.handles.write();
let mut handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
let handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
let data = handle.data.read();
handle.seek = match whence {
......
Markdown is supported
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