Skip to content

Commit f06ecd8

Browse files
committed
---
yaml --- r: 30122 b: refs/heads/incoming c: 5d56da1 h: refs/heads/master v: v3
1 parent eb3d274 commit f06ecd8

File tree

4 files changed

+32
-22
lines changed

4 files changed

+32
-22
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 38fee9526a313104e3f869bf07c24b0c1d203d11
9+
refs/heads/incoming: 5d56da1678c00ccff2c4c680de3f2245deef172a
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/hash.rs

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -131,24 +131,34 @@ impl &SipState : io::Writer {
131131
// Methods for io::writer
132132
fn write(msg: &[const u8]) {
133133

134-
#macro[[#u8to64_le(buf,i),
135-
(buf[0+i] as u64 |
136-
buf[1+i] as u64 << 8 |
137-
buf[2+i] as u64 << 16 |
138-
buf[3+i] as u64 << 24 |
139-
buf[4+i] as u64 << 32 |
140-
buf[5+i] as u64 << 40 |
141-
buf[6+i] as u64 << 48 |
142-
buf[7+i] as u64 << 56)]];
143-
144-
#macro[[#rotl(x,b), (x << b) | (x >> (64 - b))]];
145-
146-
#macro[[#compress(v0,v1,v2,v3), {
147-
v0 += v1; v1 = #rotl(v1, 13); v1 ^= v0; v0 = #rotl(v0, 32);
148-
v2 += v3; v3 = #rotl(v3, 16); v3 ^= v2;
149-
v0 += v3; v3 = #rotl(v3, 21); v3 ^= v0;
150-
v2 += v1; v1 = #rotl(v1, 17); v1 ^= v2; v2 = #rotl(v2, 32);
151-
}]];
134+
macro_rules! u8to64_le (
135+
($buf:expr, $i:expr) =>
136+
($buf[0+$i] as u64 |
137+
$buf[1+$i] as u64 << 8 |
138+
$buf[2+$i] as u64 << 16 |
139+
$buf[3+$i] as u64 << 24 |
140+
$buf[4+$i] as u64 << 32 |
141+
$buf[5+$i] as u64 << 40 |
142+
$buf[6+$i] as u64 << 48 |
143+
$buf[7+$i] as u64 << 56)
144+
);
145+
146+
macro_rules! rotl (
147+
($x:expr, $b:expr) =>
148+
(($x << $b) | ($x >> (64 - $b)))
149+
);
150+
151+
macro_rules! compress (
152+
($v0:expr, $v1:expr, $v2:expr, $v3:expr) =>
153+
{
154+
$v0 += $v1; $v1 = rotl!($v1, 13); $v1 ^= $v0;
155+
$v0 = rotl!($v0, 32);
156+
$v2 += $v3; $v3 = rotl!($v3, 16); $v3 ^= $v2;
157+
$v0 += $v3; $v3 = rotl!($v3, 21); $v3 ^= $v0;
158+
$v2 += $v1; $v1 = rotl!($v1, 17); $v1 ^= $v2;
159+
$v2 = rotl!($v2, 32);
160+
}
161+
);
152162

153163
let length = msg.len();
154164
self.length += length;

branches/incoming/src/libcore/run.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ fn program_output(prog: &str, args: &[~str]) ->
321321
errs = s;
322322
}
323323
(n, _) => {
324-
fail(#fmt("program_output received an unexpected file \
325-
number: %u", n));
324+
fail(fmt!("program_output received an unexpected file \
325+
number: %u", n));
326326
}
327327
};
328328
count -= 1;

branches/incoming/src/libcore/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ fn pop<T>(&v: ~[const T]) -> T {
541541
fn swap_remove<T>(&v: ~[const T], index: uint) -> T {
542542
let ln = len(v);
543543
if index >= ln {
544-
fail #fmt("vec::swap_remove - index %u >= length %u", index, ln);
544+
fail fmt!("vec::swap_remove - index %u >= length %u", index, ln);
545545
}
546546
let lastptr = ptr::mut_addr_of(v[ln - 1]);
547547
unsafe {

0 commit comments

Comments
 (0)