Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: fac0c68cd134
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 956f64906d33
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Sep 23, 2016

  1. Rust: style fix.

    whitequark committed Sep 23, 2016
    Copy the full SHA
    ce05eee View commit details
  2. Rust: fix incorrect use of lwip API.

    whitequark committed Sep 23, 2016
    Copy the full SHA
    956f649 View commit details
Showing with 5 additions and 5 deletions.
  1. +5 −4 artiq/runtime.rs/liblwip/lib.rs
  2. +0 −1 artiq/runtime.rs/src/io.rs
9 changes: 5 additions & 4 deletions artiq/runtime.rs/liblwip/lib.rs
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ use core::cell::RefCell;
use alloc::boxed::Box;
use collections::LinkedList;
use libc::c_void;
use std::error;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Error {
@@ -56,13 +57,13 @@ impl Error {
}
}

impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
impl core::fmt::Display for Error {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}

impl std::error::Error for Error {
impl error::Error for Error {
fn description(&self) -> &str {
self.as_str()
}
@@ -374,7 +375,7 @@ impl TcpListener {
backlog: LinkedList::new()
}));
let arg = &mut *state as *mut RefCell<TcpListenerState> as *mut _;
lwip_sys::tcp_arg(raw, arg);
lwip_sys::tcp_arg(raw2, arg);
lwip_sys::tcp_accept(raw2, accept);
Ok(TcpListener { raw: raw2, state: state })
}
1 change: 0 additions & 1 deletion artiq/runtime.rs/src/io.rs
Original file line number Diff line number Diff line change
@@ -257,7 +257,6 @@ impl<'a> TcpListener<'a> {

pub fn accept(&self) -> Result<(TcpStream, SocketAddr)> {
try!(self.waiter.tcp_acceptable(&self.lower));
loop {}
let stream_lower = self.lower.try_accept().unwrap();
let addr = SocketAddr::new(IP_ANY, 0); // FIXME: coax lwip into giving real addr here
Ok((TcpStream {