Fix compilation of graphical_debug feature and remove live feature warnings.

This commit is contained in:
Jeremy Soller
2018-11-21 19:38:14 -07:00
parent ee5c43ed45
commit 9af4d6a2e0
2 changed files with 5 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
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,

View File

@@ -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 {