Skip to content

Commit ba79ccb

Browse files
committed
---
yaml --- r: 14235 b: refs/heads/try c: 4838d78 h: refs/heads/master i: 14233: fa13aaa 14231: 78b3789 v: v3
1 parent 347b60f commit ba79ccb

File tree

10 files changed

+32
-8
lines changed

10 files changed

+32
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 3bdb627b5dc9924fbc539a1afc60bf8d280e5388
5+
refs/heads/try: 4838d7860ed07581960fff73dcb1e1848d8b363d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/libcore/i16.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
const min_value: i16 = -1i16 << 15i16;
44
const max_value: i16 = (-1i16 << 15i16) - 1i16;
55

6+
pure fn min(x: i16, y: i16) -> i16 { if x < y { x } else { y } }
7+
pure fn max(x: i16, y: i16) -> i16 { if x > y { x } else { y } }
8+
69
pure fn add(x: i16, y: i16) -> i16 { x + y }
710
pure fn sub(x: i16, y: i16) -> i16 { x - y }
811
pure fn mul(x: i16, y: i16) -> i16 { x * y }

branches/try/src/libcore/i32.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
const min_value: i32 = -1i32 << 31i32;
44
const max_value: i32 = (-1i32 << 31i32) - 1i32;
55

6+
pure fn min(x: i32, y: i32) -> i32 { if x < y { x } else { y } }
7+
pure fn max(x: i32, y: i32) -> i32 { if x > y { x } else { y } }
8+
69
pure fn add(x: i32, y: i32) -> i32 { x + y }
710
pure fn sub(x: i32, y: i32) -> i32 { x - y }
811
pure fn mul(x: i32, y: i32) -> i32 { x * y }

branches/try/src/libcore/i64.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
#[doc = "Operations and constants constants for `i64`"];
1+
#[doc = "Operations and constants for `i64`"];
22

33
const min_value: i64 = -1i64 << 63i64;
44
const max_value: i64 = (-1i64 << 63i64) - 1i64;
55

6+
pure fn min(x: i64, y: i64) -> i64 { if x < y { x } else { y } }
7+
pure fn max(x: i64, y: i64) -> i64 { if x > y { x } else { y } }
8+
69
pure fn add(x: i64, y: i64) -> i64 { x + y }
710
pure fn sub(x: i64, y: i64) -> i64 { x - y }
811
pure fn mul(x: i64, y: i64) -> i64 { x * y }

branches/try/src/libcore/i8.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
const min_value: i8 = -1i8 << 7i8;
44
const max_value: i8 = (-1i8 << 7i8) - 1i8;
55

6+
pure fn min(x: i8, y: i8) -> i8 { if x < y { x } else { y } }
7+
pure fn max(x: i8, y: i8) -> i8 { if x > y { x } else { y } }
8+
69
pure fn add(x: i8, y: i8) -> i8 { x + y }
710
pure fn sub(x: i8, y: i8) -> i8 { x - y }
811
pure fn mul(x: i8, y: i8) -> i8 { x * y }

branches/try/src/libcore/int.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ const max_value: int = (-1 << 31)-1;
2727
#[cfg(target_arch="x86_64")]
2828
const max_value: int = (-1 << 63)-1;
2929

30+
pure fn min(x: int, y: int) -> int { if x < y { x } else { y } }
31+
pure fn max(x: int, y: int) -> int { if x > y { x } else { y } }
32+
3033
/* Function: add */
3134
pure fn add(x: int, y: int) -> int { ret x + y; }
3235

branches/try/src/libcore/u16.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
const min_value: u16 = 0u16;
44
const max_value: u16 = 0u16 - 1u16;
55

6+
pure fn min(x: u16, y: u16) -> u16 { if x < y { x } else { y } }
7+
pure fn max(x: u16, y: u16) -> u16 { if x > y { x } else { y } }
8+
69
pure fn add(x: u16, y: u16) -> u16 { x + y }
710
pure fn sub(x: u16, y: u16) -> u16 { x - y }
811
pure fn mul(x: u16, y: u16) -> u16 { x * y }

branches/try/src/libcore/u32.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Return the maximal value for a u32
1818
*/
1919
const max_value: u32 = 0xffff_ffffu32;
2020

21+
pure fn min(x: u32, y: u32) -> u32 { if x < y { x } else { y } }
22+
pure fn max(x: u32, y: u32) -> u32 { if x > y { x } else { y } }
23+
2124
/* Function: add */
2225
pure fn add(x: u32, y: u32) -> u32 { ret x + y; }
2326

branches/try/src/libcore/u64.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Return the maximal value for a u64
1818
*/
1919
const max_value: u64 = 18446744073709551615u64;
2020

21+
pure fn min(x: u64, y: u64) -> u64 { if x < y { x } else { y } }
22+
pure fn max(x: u64, y: u64) -> u64 { if x > y { x } else { y } }
23+
2124
/* Function: add */
2225
pure fn add(x: u64, y: u64) -> u64 { ret x + y; }
2326

branches/try/src/libcore/uint.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ This is 2^wordsize - 1
2323
const max_value: uint = 0u - 1u;
2424

2525
/*
26-
Function: max
26+
Function: min
2727
*/
28-
pure fn max(x: uint, y: uint) -> uint {
29-
if x > y { x } else { y }
28+
pure fn min(x: uint, y: uint) -> uint {
29+
if x < y { x } else { y }
3030
}
3131

3232
/*
33-
Function: min
33+
Function: max
3434
*/
35-
pure fn min(x: uint, y: uint) -> uint {
36-
if x < y { x } else { y }
35+
pure fn max(x: uint, y: uint) -> uint {
36+
if x > y { x } else { y }
3737
}
3838

3939
/* Function: add */

0 commit comments

Comments
 (0)