Rename split_u32 -> split_i32

This commit is contained in:
Alexandre Bury 2017-11-19 01:14:53 -08:00
parent a11d02dfa4
commit eeca719a92
3 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,7 @@ mod pan;
#[cfg(feature = "pancurses")]
pub use self::pan::*;
fn split_u32(code: i32) -> Vec<u8> {
fn split_i32(code: i32) -> Vec<u8> {
(0..4).map(|i| ((code >> (8 * i)) & 0xFF) as u8).collect()
}

View File

@ -1,7 +1,7 @@
extern crate ncurses;
use self::ncurses::mmask_t;
use self::super::{find_closest, split_u32};
use self::super::{find_closest, split_i32};
use backend;
use event::{Event, Key, MouseButton, MouseEvent};
use std::cell::{Cell, RefCell};
@ -257,7 +257,7 @@ impl Concrete {
c @ 1...25 => Event::CtrlChar((b'a' + (c - 1) as u8) as char),
other => {
// Split the i32 into 4 bytes
Event::Unknown(split_u32(other))
Event::Unknown(split_i32(other))
}
}
}

View File

@ -1,7 +1,7 @@
extern crate pancurses;
use self::pancurses::mmask_t;
use self::super::{find_closest, split_u32};
use self::super::{find_closest, split_i32};
use backend;
use event::{Event, Key, MouseButton, MouseEvent};
use std::cell::{Cell, RefCell};
@ -69,7 +69,7 @@ impl Concrete {
fn parse_mouse_event(&mut self) -> Event {
let mut mevent = match pancurses::getmouse() {
Err(code) => return Event::Unknown(split_u32(code)),
Err(code) => return Event::Unknown(split_i32(code)),
Ok(event) => event,
};
@ -301,7 +301,7 @@ impl backend::Backend for Concrete {
270 => Event::CtrlShift(Key::Up),
other => {
eprintln!("Unknown: {}", other);
Event::Unknown(split_u32(other))
Event::Unknown(split_i32(other))
}
},
// TODO: I honestly have no fucking idea what KeyCodeYes is