-
Notifications
You must be signed in to change notification settings - Fork 0
/
ssbc.rs.patch
55 lines (55 loc) · 1.48 KB
/
ssbc.rs.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
0a1,2
> ///! Version of main.rs with no dependancies, for compiling with rustc 1.14.1 on otter
> ///! compile with `build.sh`
7c9,12
< use derive_more::{Add, AddAssign, Sub, SubAssign};
---
> use std::u16;
>
> // Macros we could use on Addr, but don't because otter doesn't have cargo.
> // use derive_more::{Add, AddAssign, Sub, SubAssign};
11c16
< #[derive(Default, Copy, Clone, Add, AddAssign, Sub, SubAssign)]
---
> #[derive(Default, Copy, Clone)] //, Add, AddAssign, Sub, SubAssign
21c26
< addr.0.0
---
> (addr.0).0
26c31
< addr.0.0 as usize
---
> (addr.0).0 as usize
37c42,71
< f.write_fmt(format_args!("{:#04x}", self.0.0))
---
> f.write_fmt(format_args!("{:#04x}", (self.0).0))
> }
> }
>
> // Could use derive_more instead of manual impl, but cargo isn't installed on the lab machines :(
> // (these impl's were generated by `cargo expand`)
> impl ::core::ops::Add for Addr {
> type Output = Addr;
> #[inline]
> fn add(self, rhs: Addr) -> Addr {
> Addr(self.0.add(rhs.0))
> }
> }
> impl ::core::ops::AddAssign for Addr {
> #[inline]
> fn add_assign(&mut self, rhs: Addr) {
> self.0.add_assign(rhs.0);
> }
> }
> impl ::core::ops::Sub for Addr {
> type Output = Addr;
> #[inline]
> fn sub(self, rhs: Addr) -> Addr {
> Addr(self.0.sub(rhs.0))
> }
> }
> impl ::core::ops::SubAssign for Addr {
> #[inline]
> fn sub_assign(&mut self, rhs: Addr) {
> self.0.sub_assign(rhs.0);