Skip to content

Commit 579e610

Browse files
committed
---
yaml --- r: 102133 b: refs/heads/master c: 9e8d5aa h: refs/heads/master i: 102131: 4b9c235 v: v3
1 parent cc0114a commit 579e610

File tree

5 files changed

+10
-17
lines changed

5 files changed

+10
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 4cc723dc22e5ebcbac4dc431a82ea75bc9ae6017
2+
refs/heads/master: 9e8d5aa29e40066b9c247ef252b58c2092ecdfae
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/src/libarena/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,12 @@ unsafe fn destroy_chunk(chunk: &Chunk) {
167167
// is necessary in order to properly do cleanup if a failure occurs
168168
// during an initializer.
169169
#[inline]
170-
unsafe fn bitpack_tydesc_ptr(p: *TyDesc, is_done: bool) -> uint {
171-
let p_bits: uint = transmute(p);
172-
p_bits | (is_done as uint)
170+
fn bitpack_tydesc_ptr(p: *TyDesc, is_done: bool) -> uint {
171+
p as uint | (is_done as uint)
173172
}
174173
#[inline]
175-
unsafe fn un_bitpack_tydesc_ptr(p: uint) -> (*TyDesc, bool) {
176-
(transmute(p & !1), p & 1 == 1)
174+
fn un_bitpack_tydesc_ptr(p: uint) -> (*TyDesc, bool) {
175+
((p & !1) as *TyDesc, p & 1 == 1)
177176
}
178177

179178
impl Arena {

trunk/src/libserialize/ebml.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@ pub mod reader {
161161
];
162162

163163
unsafe {
164-
let (ptr, _): (*u8, uint) = transmute(data);
165-
let ptr = ptr.offset(start as int);
166-
let ptr: *i32 = transmute(ptr);
164+
let ptr = data.as_ptr().offset(start as int) as *i32;
167165
let val = from_be32(*ptr) as u32;
168166

169167
let i = (val >> 28u) as uint;

trunk/src/libstd/num/f32.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,8 @@ impl Float for f32 {
351351
static EXP_MASK: u32 = 0x7f800000;
352352
static MAN_MASK: u32 = 0x007fffff;
353353

354-
match (
355-
unsafe { ::cast::transmute::<f32,u32>(*self) } & MAN_MASK,
356-
unsafe { ::cast::transmute::<f32,u32>(*self) } & EXP_MASK,
357-
) {
354+
let bits: u32 = unsafe {::cast::transmute(*self)};
355+
match (bits & MAN_MASK, bits & EXP_MASK) {
358356
(0, 0) => FPZero,
359357
(_, 0) => FPSubnormal,
360358
(0, EXP_MASK) => FPInfinite,

trunk/src/libstd/num/f64.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,8 @@ impl Float for f64 {
353353
static EXP_MASK: u64 = 0x7ff0000000000000;
354354
static MAN_MASK: u64 = 0x000fffffffffffff;
355355

356-
match (
357-
unsafe { ::cast::transmute::<f64,u64>(*self) } & MAN_MASK,
358-
unsafe { ::cast::transmute::<f64,u64>(*self) } & EXP_MASK,
359-
) {
356+
let bits: u64 = unsafe {::cast::transmute(*self)};
357+
match (bits & MAN_MASK, bits & EXP_MASK) {
360358
(0, 0) => FPZero,
361359
(_, 0) => FPSubnormal,
362360
(0, EXP_MASK) => FPInfinite,

0 commit comments

Comments
 (0)