Bring up to date with Rust 1.39
This commit is contained in:
parent
533640efa7
commit
f67bb140c8
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "dmd_core"
|
||||
description = "AT&T / Teletype DMD 5620 Terminal Emulator - Core Library"
|
||||
version = "0.6.3"
|
||||
version = "0.6.4"
|
||||
authors = ["Seth Morabito <web@loomcom.com>"]
|
||||
homepage = "https://github.com/sethm/dmd_core"
|
||||
repository = "https://github.com/sethm/dmd_core"
|
||||
|
@ -11,8 +11,8 @@ license = "MIT"
|
|||
categories = ["simulation"]
|
||||
|
||||
[dependencies]
|
||||
lazy_static = "^1.2.0"
|
||||
libc = "^0.2.45"
|
||||
lazy_static = "^1.4.0"
|
||||
libc = "^0.2.66"
|
||||
|
||||
[profile.release]
|
||||
debug = true
|
||||
|
|
|
@ -77,7 +77,7 @@ impl Bus {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_device(&mut self, address: usize) -> Result<&mut Device, BusError> {
|
||||
fn get_device(&mut self, address: usize) -> Result<&mut dyn Device, BusError> {
|
||||
if address < 0x20000 {
|
||||
return Ok(&mut self.rom);
|
||||
}
|
||||
|
|
24
src/dmd.rs
24
src/dmd.rs
|
@ -183,7 +183,7 @@ fn dmd_step_loop(steps: usize) -> c_int {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn dmd_get_pc(pc: &mut uint32_t) -> c_int {
|
||||
fn dmd_get_pc(pc: &mut u32) -> c_int {
|
||||
match DMD.lock() {
|
||||
Ok(dmd) => {
|
||||
*pc = dmd.get_pc();
|
||||
|
@ -194,7 +194,7 @@ fn dmd_get_pc(pc: &mut uint32_t) -> c_int {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn dmd_get_register(reg: uint8_t, val: &mut uint32_t) -> c_int {
|
||||
fn dmd_get_register(reg: u8, val: &mut u32) -> c_int {
|
||||
match DMD.lock() {
|
||||
Ok(dmd) => {
|
||||
*val = dmd.get_register(reg);
|
||||
|
@ -205,7 +205,7 @@ fn dmd_get_register(reg: uint8_t, val: &mut uint32_t) -> c_int {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn dmd_read_word(addr: uint32_t, val: &mut uint32_t) -> c_int {
|
||||
fn dmd_read_word(addr: u32, val: &mut u32) -> c_int {
|
||||
match DMD.lock() {
|
||||
Ok(mut dmd) => {
|
||||
match dmd.read_word(addr as usize) {
|
||||
|
@ -221,7 +221,7 @@ fn dmd_read_word(addr: uint32_t, val: &mut uint32_t) -> c_int {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn dmd_read_byte(addr: uint32_t, val: &mut uint8_t) -> c_int {
|
||||
fn dmd_read_byte(addr: u32, val: &mut u8) -> c_int {
|
||||
match DMD.lock() {
|
||||
Ok(mut dmd) => {
|
||||
match dmd.read_byte(addr as usize) {
|
||||
|
@ -237,7 +237,7 @@ fn dmd_read_byte(addr: uint32_t, val: &mut uint8_t) -> c_int {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn dmd_get_duart_output_port(oport: &mut uint8_t) -> c_int {
|
||||
fn dmd_get_duart_output_port(oport: &mut u8) -> c_int {
|
||||
match DMD.lock() {
|
||||
Ok(dmd) => {
|
||||
*oport = dmd.duart_output();
|
||||
|
@ -248,7 +248,7 @@ fn dmd_get_duart_output_port(oport: &mut uint8_t) -> c_int {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn dmd_rx_char(c: uint8_t) -> c_int {
|
||||
fn dmd_rx_char(c: u8) -> c_int {
|
||||
match DMD.lock() {
|
||||
Ok(mut dmd) => {
|
||||
dmd.rx_char(c as u8);
|
||||
|
@ -259,7 +259,7 @@ fn dmd_rx_char(c: uint8_t) -> c_int {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn dmd_rx_keyboard(c: uint8_t) -> c_int {
|
||||
fn dmd_rx_keyboard(c: u8) -> c_int {
|
||||
match DMD.lock() {
|
||||
Ok(mut dmd) => {
|
||||
dmd.rx_keyboard(c);
|
||||
|
@ -270,7 +270,7 @@ fn dmd_rx_keyboard(c: uint8_t) -> c_int {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn dmd_mouse_move(x: uint16_t, y: uint16_t) -> c_int {
|
||||
fn dmd_mouse_move(x: u16, y: u16) -> c_int {
|
||||
match DMD.lock() {
|
||||
Ok(mut dmd) => {
|
||||
dmd.mouse_move(x, y);
|
||||
|
@ -281,7 +281,7 @@ fn dmd_mouse_move(x: uint16_t, y: uint16_t) -> c_int {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn dmd_mouse_down(button: uint8_t) -> c_int {
|
||||
fn dmd_mouse_down(button: u8) -> c_int {
|
||||
match DMD.lock() {
|
||||
Ok(mut dmd) => {
|
||||
dmd.mouse_down(button);
|
||||
|
@ -292,7 +292,7 @@ fn dmd_mouse_down(button: uint8_t) -> c_int {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn dmd_mouse_up(button: uint8_t) -> c_int {
|
||||
fn dmd_mouse_up(button: u8) -> c_int {
|
||||
match DMD.lock() {
|
||||
Ok(mut dmd) => {
|
||||
dmd.mouse_up(button);
|
||||
|
@ -303,7 +303,7 @@ fn dmd_mouse_up(button: uint8_t) -> c_int {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn dmd_rs232_tx_poll(tx_char: &mut uint8_t) -> c_int {
|
||||
fn dmd_rs232_tx_poll(tx_char: &mut u8) -> c_int {
|
||||
match DMD.lock() {
|
||||
Ok(mut dmd) => {
|
||||
match dmd.rs232_tx_poll() {
|
||||
|
@ -319,7 +319,7 @@ fn dmd_rs232_tx_poll(tx_char: &mut uint8_t) -> c_int {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn dmd_kb_tx_poll(tx_char: &mut uint8_t) -> c_int {
|
||||
fn dmd_kb_tx_poll(tx_char: &mut u8) -> c_int {
|
||||
match DMD.lock() {
|
||||
Ok(mut dmd) => {
|
||||
match dmd.kb_tx_poll() {
|
||||
|
|
|
@ -30,7 +30,7 @@ impl Error for CpuException {
|
|||
}
|
||||
}
|
||||
|
||||
fn cause(&self) -> Option<&Error> {
|
||||
fn cause(&self) -> Option<&dyn Error> {
|
||||
match *self {
|
||||
CpuException::IllegalOpcode => None,
|
||||
CpuException::InvalidDescriptor => None,
|
||||
|
@ -78,7 +78,7 @@ impl Error for BusError {
|
|||
}
|
||||
}
|
||||
|
||||
fn cause(&self) -> Option<&Error> {
|
||||
fn cause(&self) -> Option<&dyn Error> {
|
||||
match *self {
|
||||
BusError::Init => None,
|
||||
BusError::Read(_) => None,
|
||||
|
@ -114,7 +114,7 @@ impl Error for CpuError {
|
|||
}
|
||||
}
|
||||
|
||||
fn cause(&self) -> Option<&Error> {
|
||||
fn cause(&self) -> Option<&dyn Error> {
|
||||
match *self {
|
||||
CpuError::Exception(ref e) => Some(e),
|
||||
CpuError::Bus(ref e) => Some(e),
|
||||
|
|
Loading…
Reference in New Issue