This repository was archived by the owner on Jul 6, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ static ISRCount: uint = 16;
46
46
47
47
#[ link_section=".isr_vector" ]
48
48
#[ no_mangle]
49
- pub static ISRVectors : [ Option < extern unsafe fn ( ) > , ..ISRCount ] = [
49
+ pub static ISRVectors : [ Option < unsafe extern fn ( ) > , ..ISRCount ] = [
50
50
Some ( __STACK_BASE) ,
51
51
Some ( main) , // Reset
52
52
Some ( isr_nmi) , // NMI
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ static ISRCount: uint = 35;
57
57
58
58
#[ link_section=".isr_vector_nvic" ]
59
59
#[ no_mangle]
60
- pub static NVICVectors : [ Option < extern unsafe fn ( ) > , ..ISRCount ] = [
60
+ pub static NVICVectors : [ Option < unsafe extern fn ( ) > , ..ISRCount ] = [
61
61
// s.a. lpc17xx user manual, table 50 (chapter 6.3)
62
62
Some ( isr_wdt) ,
63
63
Some ( isr_timer_0) ,
Original file line number Diff line number Diff line change 17
17
18
18
use core:: kinds:: marker;
19
19
use core:: intrinsics:: { volatile_load, volatile_store} ;
20
- use core:: cast:: transmute_mut_unsafe;
21
20
21
+ // TODO(bharrisau) I don't know enough about markers - is it better
22
+ // to just use an Unsafe<T> here instead?
22
23
pub struct VolatileCell < T > {
23
24
value : T ,
24
25
invariant : marker:: InvariantType < T > ,
@@ -42,7 +43,7 @@ impl<T> VolatileCell<T> {
42
43
#[ inline]
43
44
pub fn set ( & self , value : T ) {
44
45
unsafe {
45
- volatile_store ( & mut ( * transmute_mut_unsafe ( & self . value ) ) , value)
46
+ volatile_store ( & self . value as * T as * mut T , value)
46
47
}
47
48
}
48
49
}
Original file line number Diff line number Diff line change 15
15
16
16
//! debug::port provides interface to output structured data over serial port.
17
17
18
- use core:: mem:: size_of;
19
- use core:: cast:: transmute;
18
+ use core:: mem:: { size_of, transmute} ;
20
19
use core:: intrinsics:: abort;
21
20
22
21
use drivers:: chario:: CharIO ;
You can’t perform that action at this time.
0 commit comments