View fifo.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::default::Default; | |
struct Fifo<T> { | |
buffer: [T; BUFFER_SIZE], | |
windex: Index, | |
rindex: Index, | |
} | |
impl<T: Default + Copy> Fifo<T> { | |
fn new() -> Fifo<T> { |
View gist:6f252c256d11d2cb78f6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/main.rs:126:23: 126:86 error: mismatched types: | |
expected `*const libc::types::common::c95::c_void`, | |
found `*const libc::types::common::c95::c_void` | |
(expected enum `libc::types::common::c95::c_void`, | |
found a different enum `libc::types::common::c95::c_void`) [E0308] |
View gist:6f23ed95af7a8c8240b8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int foo() { | |
return 0; | |
} | |
int bar(void) { | |
return 0; | |
} | |
int main() { | |
foo(42); |
View gist:cdd520b5db9308fb02d9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compiling rustbook v0.3.0 (file:///home/simias/src/rustbook) | |
src/main.rs:13:1: 13:18 error: unstable feature | |
src/main.rs:13 #![feature(core)] | |
^~~~~~~~~~~~~~~~~ | |
note: this feature may not be used in the beta release channel | |
src/main.rs:14:1: 14:25 error: unstable feature | |
src/main.rs:14 #![feature(exit_status)] | |
^~~~~~~~~~~~~~~~~~~~~~~~ | |
note: this feature may not be used in the beta release channel | |
src/main.rs:15:1: 15:21 error: unstable feature |
View gist:756db24070d79112a959
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/main.rs:22:31: 22:35 error: cannot borrow `*self` as mutable more than once at a time | |
src/main.rs:22 while let Some(msg) = self.next_packet() { | |
^~~~ | |
src/main.rs:22:31: 22:35 note: previous borrow of `*self` occurs here; the mutable borrow prevents subsequent moves, borrows, or modification of `*self` until the borrow ends | |
src/main.rs:22 while let Some(msg) = self.next_packet() { | |
^~~~ |
View gist:51a8b1f26c27b604b6ec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(no_std,core)] | |
#![no_std] | |
#![crate_type = "staticlib"] | |
#![feature(lang_items)] | |
extern crate core; | |
fn main() { | |
} |
View gist:e65feefce18b0f5ee256
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(lang_items)] | |
#![feature(no_std,core)] | |
#![no_std] | |
#![crate_type = "staticlib"] | |
extern crate core; | |
// Various lang items required by rustc | |
#[lang = "stack_exhausted"] | |
extern fn stack_exhausted() {} |
View gist:fcd543037dab4ebd7256
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OBJS = genplus-ntsc-md.o md_ntsc.o | |
NTSC_VARIANT = NTSC_COMPOSITE | |
CFLAGS = -fPIC -O2 -D$(NTSC_VARIANT) | |
all: genplus-ntsc.so genplus-ntsc.a | |
genplus-ntsc.so: $(OBJS) | |
$(CC) -shared -o $@ $(OBJS) |
View gist:e31e5e4346ca6969fb20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl GdbRemote { | |
fn send_reply(&mut self, reply: Reply) -> Result<(), ()> { | |
match self.remote.write(&reply.into_packet()) { | |
//... | |
} | |
} | |
} | |
impl Reply { | |
pub fn into_packet(mut self) -> Vec<u8> { |
View gist:f28c345d70b4116f7a97
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.section .text._ZN4uart4Uart4putc20hec954448b6b2526apaaE,"ax",@progbits | |
.globl _ZN4uart4Uart4putc20hec954448b6b2526apaaE | |
.align 2 | |
.type _ZN4uart4Uart4putc20hec954448b6b2526apaaE,@function | |
.set nomicromips | |
.set nomips16 | |
.ent _ZN4uart4Uart4putc20hec954448b6b2526apaaE | |
_ZN4uart4Uart4putc20hec954448b6b2526apaaE: | |
.cfi_startproc | |
.frame $fp,8,$ra |
OlderNewer