File tree Expand file tree Collapse file tree 5 files changed +10
-17
lines changed Expand file tree Collapse file tree 5 files changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5
5
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: 4cc723dc22e5ebcbac4dc431a82ea75bc9ae6017
8
+ refs/heads/try2: 9e8d5aa29e40066b9c247ef252b58c2092ecdfae
9
9
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -167,13 +167,12 @@ unsafe fn destroy_chunk(chunk: &Chunk) {
167
167
// is necessary in order to properly do cleanup if a failure occurs
168
168
// during an initializer.
169
169
#[ 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 )
173
172
}
174
173
#[ 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 )
177
176
}
178
177
179
178
impl Arena {
Original file line number Diff line number Diff line change @@ -161,9 +161,7 @@ pub mod reader {
161
161
] ;
162
162
163
163
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 ;
167
165
let val = from_be32 ( * ptr) as u32 ;
168
166
169
167
let i = ( val >> 28 u) as uint ;
Original file line number Diff line number Diff line change @@ -351,10 +351,8 @@ impl Float for f32 {
351
351
static EXP_MASK : u32 = 0x7f800000 ;
352
352
static MAN_MASK : u32 = 0x007fffff ;
353
353
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 ) {
358
356
( 0 , 0 ) => FPZero ,
359
357
( _, 0 ) => FPSubnormal ,
360
358
( 0 , EXP_MASK ) => FPInfinite ,
Original file line number Diff line number Diff line change @@ -353,10 +353,8 @@ impl Float for f64 {
353
353
static EXP_MASK : u64 = 0x7ff0000000000000 ;
354
354
static MAN_MASK : u64 = 0x000fffffffffffff ;
355
355
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 ) {
360
358
( 0 , 0 ) => FPZero ,
361
359
( _, 0 ) => FPSubnormal ,
362
360
( 0 , EXP_MASK ) => FPInfinite ,
You can’t perform that action at this time.
0 commit comments