File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ pub fn fields(
257
257
access : f. access ,
258
258
evs : & f. enumerated_values ,
259
259
sc : Ident :: new ( & * sc) ,
260
- mask : util:: hex_or_bool ( ( ( ( 1 as u64 ) << width) - 1 ) as u32 , width ) ,
260
+ mask : util:: hex ( ( ( ( 1 as u64 ) << width) - 1 ) as u32 ) ,
261
261
name : & f. name ,
262
262
offset : util:: unsuffixed ( u64:: from ( f. bit_range . offset ) ) ,
263
263
ty : width. to_ty ( ) ?,
@@ -285,7 +285,7 @@ pub fn fields(
285
285
quote ! { as #fty }
286
286
} ;
287
287
let value = quote ! {
288
- ( ( self . bits >> #offset) & #mask as #rty ) #cast
288
+ ( ( self . bits >> #offset) & #mask) #cast
289
289
} ;
290
290
291
291
if let Some ( ( evs, base) ) = lookup (
@@ -760,8 +760,8 @@ pub fn fields(
760
760
/// Writes raw bits to the field
761
761
#[ inline]
762
762
pub #unsafety fn #bits( self , value: #fty) -> & ' a mut W {
763
- self . w. bits &= !( ( #mask as #rty ) << #offset) ;
764
- self . w. bits |= ( ( value & #mask ) as #rty ) << #offset;
763
+ self . w. bits &= !( #mask << #offset) ;
764
+ self . w. bits |= ( ( value as #rty ) & #mask ) << #offset;
765
765
self . w
766
766
}
767
767
} ) ;
You can’t perform that action at this time.
0 commit comments