Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

Commit

Permalink
Merge pull request #40 from bharrisau/remove_cast
Browse files Browse the repository at this point in the history
Removes references to cast module.
  • Loading branch information
bharrisau committed May 20, 2014
2 parents a26f8be + f2d6868 commit 3098bdf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/hal/cortex_m3/isr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static ISRCount: uint = 16;

#[link_section=".isr_vector"]
#[no_mangle]
pub static ISRVectors: [Option<extern unsafe fn()>, ..ISRCount] = [
pub static ISRVectors: [Option<unsafe extern fn()>, ..ISRCount] = [
Some(__STACK_BASE),
Some(main), // Reset
Some(isr_nmi), // NMI
Expand Down
2 changes: 1 addition & 1 deletion src/hal/lpc17xx/isr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static ISRCount: uint = 35;

#[link_section=".isr_vector_nvic"]
#[no_mangle]
pub static NVICVectors: [Option<extern unsafe fn()>, ..ISRCount] = [
pub static NVICVectors: [Option<unsafe extern fn()>, ..ISRCount] = [
// s.a. lpc17xx user manual, table 50 (chapter 6.3)
Some(isr_wdt),
Some(isr_timer_0),
Expand Down
5 changes: 3 additions & 2 deletions src/lib/volatile_cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@

use core::kinds::marker;
use core::intrinsics::{volatile_load, volatile_store};
use core::cast::transmute_mut_unsafe;

// TODO(bharrisau) I don't know enough about markers - is it better
// to just use an Unsafe<T> here instead?
pub struct VolatileCell<T> {
value: T,
invariant: marker::InvariantType<T>,
Expand All @@ -42,7 +43,7 @@ impl<T> VolatileCell<T> {
#[inline]
pub fn set(&self, value: T) {
unsafe {
volatile_store(&mut (*transmute_mut_unsafe(&self.value)), value)
volatile_store(&self.value as *T as *mut T, value)
}
}
}
3 changes: 1 addition & 2 deletions src/os/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

//! debug::port provides interface to output structured data over serial port.

use core::mem::size_of;
use core::cast::transmute;
use core::mem::{size_of, transmute};
use core::intrinsics::abort;

use drivers::chario::CharIO;
Expand Down

0 comments on commit 3098bdf

Please sign in to comment.