Skip to content

Commit 9f1fa72

Browse files
committed
---
yaml --- r: 7071 b: refs/heads/master c: 295df68 h: refs/heads/master i: 7069: 7989957 7067: 8eec970 7063: e3e740a 7055: 38c79d0 7039: 7f108c0 v: v3
1 parent 061e639 commit 9f1fa72

File tree

7 files changed

+5
-200
lines changed

7 files changed

+5
-200
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 3e68803891dc384e8c3e5a24bb17700187d86cf7
2+
refs/heads/master: 295df68faf1e881d7fda09406f47bb99ef7f4d43

trunk/src/libcore/u32.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -16,49 +16,6 @@ Return the maximal value for a u32
1616
*/
1717
const max_value: u32 = 0xffff_ffffu32;
1818

19-
/* Function: add */
20-
pure fn add(x: u32, y: u32) -> u32 { ret x + y; }
21-
22-
/* Function: sub */
23-
pure fn sub(x: u32, y: u32) -> u32 { ret x - y; }
24-
25-
/* Function: mul */
26-
pure fn mul(x: u32, y: u32) -> u32 { ret x * y; }
27-
28-
/* Function: div */
29-
pure fn div(x: u32, y: u32) -> u32 { ret x / y; }
30-
31-
/* Function: rem */
32-
pure fn rem(x: u32, y: u32) -> u32 { ret x % y; }
33-
34-
/* Predicate: lt */
35-
pure fn lt(x: u32, y: u32) -> bool { ret x < y; }
36-
37-
/* Predicate: le */
38-
pure fn le(x: u32, y: u32) -> bool { ret x <= y; }
39-
40-
/* Predicate: eq */
41-
pure fn eq(x: u32, y: u32) -> bool { ret x == y; }
42-
43-
/* Predicate: ne */
44-
pure fn ne(x: u32, y: u32) -> bool { ret x != y; }
45-
46-
/* Predicate: ge */
47-
pure fn ge(x: u32, y: u32) -> bool { ret x >= y; }
48-
49-
/* Predicate: gt */
50-
pure fn gt(x: u32, y: u32) -> bool { ret x > y; }
51-
52-
/*
53-
Function: range
54-
55-
Iterate over the range [`lo`..`hi`)
56-
*/
57-
fn range(lo: u32, hi: u32, it: block(u32)) {
58-
let i = lo;
59-
while i < hi { it(i); i += 1u32; }
60-
}
61-
6219
//
6320
// Local Variables:
6421
// mode: rust

trunk/src/libcore/u64.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -16,49 +16,6 @@ Return the maximal value for a u64
1616
*/
1717
const max_value: u64 = 18446744073709551615u64;
1818

19-
/* Function: add */
20-
pure fn add(x: u64, y: u64) -> u64 { ret x + y; }
21-
22-
/* Function: sub */
23-
pure fn sub(x: u64, y: u64) -> u64 { ret x - y; }
24-
25-
/* Function: mul */
26-
pure fn mul(x: u64, y: u64) -> u64 { ret x * y; }
27-
28-
/* Function: div */
29-
pure fn div(x: u64, y: u64) -> u64 { ret x / y; }
30-
31-
/* Function: rem */
32-
pure fn rem(x: u64, y: u64) -> u64 { ret x % y; }
33-
34-
/* Predicate: lt */
35-
pure fn lt(x: u64, y: u64) -> bool { ret x < y; }
36-
37-
/* Predicate: le */
38-
pure fn le(x: u64, y: u64) -> bool { ret x <= y; }
39-
40-
/* Predicate: eq */
41-
pure fn eq(x: u64, y: u64) -> bool { ret x == y; }
42-
43-
/* Predicate: ne */
44-
pure fn ne(x: u64, y: u64) -> bool { ret x != y; }
45-
46-
/* Predicate: ge */
47-
pure fn ge(x: u64, y: u64) -> bool { ret x >= y; }
48-
49-
/* Predicate: gt */
50-
pure fn gt(x: u64, y: u64) -> bool { ret x > y; }
51-
52-
/*
53-
Function: range
54-
55-
Iterate over the range [`lo`..`hi`)
56-
*/
57-
fn range(lo: u64, hi: u64, it: block(u64)) {
58-
let i = lo;
59-
while i < hi { it(i); i += 1u64; }
60-
}
61-
6219
/*
6320
Function: to_str
6421

trunk/src/libcore/uint.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,6 @@ pure fn ge(x: uint, y: uint) -> bool { ret x >= y; }
103103
/* Predicate: gt */
104104
pure fn gt(x: uint, y: uint) -> bool { ret x > y; }
105105

106-
/*
107-
Function: hash
108-
109-
Produce a uint suitable for use in a hash table
110-
*/
111-
fn hash(x: uint) -> uint { ret x; }
112-
113106
/*
114107
Function: range
115108

trunk/src/libcore/vec.rs

Lines changed: 1 addition & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ Function: enum_chars
709709
710710
Returns a vector containing a range of chars
711711
*/
712-
fn enum_chars(start: u8, end: u8) : ::u8::le(start, end) -> [char] {
712+
fn enum_chars(start: u8, end: u8) : u8::le(start, end) -> [char] {
713713
let i = start;
714714
let r = [];
715715
while i <= end { r += [i as char]; i += 1u as u8; }
@@ -879,99 +879,6 @@ mod unsafe {
879879
}
880880
}
881881

882-
/*
883-
Module: u8
884-
*/
885-
mod u8 {
886-
export cmp;
887-
export lt, le, eq, ne, ge, gt;
888-
export hash;
889-
890-
#[nolink]
891-
#[abi = "cdecl"]
892-
native mod libc {
893-
fn memcmp(s1: *u8, s2: *u8, n: ctypes::size_t) -> ctypes::c_int;
894-
}
895-
896-
/*
897-
Function cmp
898-
899-
Bytewise string comparison
900-
*/
901-
pure fn cmp(&&a: [u8], &&b: [u8]) -> int unsafe {
902-
let a_len = len(a);
903-
let b_len = len(b);
904-
let n = math::min(a_len, b_len) as ctypes::size_t;
905-
let r = libc::memcmp(to_ptr(a), to_ptr(b), n) as int;
906-
907-
if r != 0 { r } else {
908-
if a_len == b_len {
909-
0
910-
} else if a_len < b_len {
911-
-1
912-
} else {
913-
1
914-
}
915-
}
916-
}
917-
918-
/*
919-
Function: lt
920-
921-
Bytewise less than or equal
922-
*/
923-
pure fn lt(&&a: [u8], &&b: [u8]) -> bool { cmp(a, b) < 0 }
924-
925-
/*
926-
Function: le
927-
928-
Bytewise less than or equal
929-
*/
930-
pure fn le(&&a: [u8], &&b: [u8]) -> bool { cmp(a, b) <= 0 }
931-
932-
/*
933-
Function: eq
934-
935-
Bytewise equality
936-
*/
937-
pure fn eq(&&a: [u8], &&b: [u8]) -> bool unsafe { cmp(a, b) == 0 }
938-
939-
/*
940-
Function: ne
941-
942-
Bytewise inequality
943-
*/
944-
pure fn ne(&&a: [u8], &&b: [u8]) -> bool unsafe { cmp(a, b) != 0 }
945-
946-
/*
947-
Function: ge
948-
949-
Bytewise greater than or equal
950-
*/
951-
pure fn ge(&&a: [u8], &&b: [u8]) -> bool { cmp(a, b) >= 0 }
952-
953-
/*
954-
Function: gt
955-
956-
Bytewise greater than
957-
*/
958-
pure fn gt(&&a: [u8], &&b: [u8]) -> bool { cmp(a, b) > 0 }
959-
960-
/*
961-
Function: hash
962-
963-
String hash function
964-
*/
965-
fn hash(&&s: [u8]) -> uint {
966-
// djb hash.
967-
// FIXME: replace with murmur.
968-
969-
let u: uint = 5381u;
970-
vec::iter(s, { |c| u *= 33u; u += c as uint; });
971-
ret u;
972-
}
973-
}
974-
975882
// Local Variables:
976883
// mode: rust;
977884
// fill-column: 78;

trunk/src/libstd/map.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -378,22 +378,13 @@ fn new_str_hash<V: copy>() -> hashmap<str, V> {
378378
ret mk_hashmap(str::hash, str::eq);
379379
}
380380

381-
/*
382-
Function: new_bytes_hash
383-
384-
Construct a hashmap for byte string keys
385-
*/
386-
fn new_bytes_hash<V: copy>() -> hashmap<[u8], V> {
387-
ret mk_hashmap(vec::u8::hash, vec::u8::eq);
388-
}
389-
390381
/*
391382
Function: new_int_hash
392383
393384
Construct a hashmap for int keys
394385
*/
395386
fn new_int_hash<V: copy>() -> hashmap<int, V> {
396-
fn hash_int(&&x: int) -> uint { int::hash(x) }
387+
fn hash_int(&&x: int) -> uint { ret x as uint; }
397388
fn eq_int(&&a: int, &&b: int) -> bool { ret a == b; }
398389
ret mk_hashmap(hash_int, eq_int);
399390
}
@@ -404,7 +395,7 @@ Function: new_uint_hash
404395
Construct a hashmap for uint keys
405396
*/
406397
fn new_uint_hash<V: copy>() -> hashmap<uint, V> {
407-
fn hash_uint(&&x: uint) -> uint { uint::hash(x) }
398+
fn hash_uint(&&x: uint) -> uint { ret x; }
408399
fn eq_uint(&&a: uint, &&b: uint) -> bool { ret a == b; }
409400
ret mk_hashmap(hash_uint, eq_uint);
410401
}

trunk/src/rt/arch/i386/context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct registers_t {
2727
uint32_t eflags;
2828

2929
uint32_t eip;
30-
};
30+
} __attribute__((aligned(16)));
3131

3232
extern "C" void __morestack(void *args, void *fn_ptr, uintptr_t stack_ptr);
3333

0 commit comments

Comments
 (0)