File tree 3 files changed +55
-1
lines changed 3 files changed +55
-1
lines changed Original file line number Diff line number Diff line change @@ -596,7 +596,7 @@ impl<'a> Bitfield<'a> {
596
596
let field_type = field_item. to_rust_ty ( ctx) ;
597
597
let int_type = BlobTyBuilder :: new ( field_ty_layout) . build ( ) ;
598
598
599
- let getter_name = ctx. ext_cx ( ) . ident_of ( & field_name) ;
599
+ let getter_name = ctx. rust_ident ( & field_name) ;
600
600
let setter_name = ctx. ext_cx ( )
601
601
. ident_of ( & format ! ( "set_{}" , & field_name) ) ;
602
602
let mask = ( ( 1usize << width) - 1 ) << offset;
Original file line number Diff line number Diff line change
1
+ /* automatically generated by rust-bindgen */
2
+
3
+
4
+ #![ allow( non_snake_case) ]
5
+
6
+
7
+ #[ repr( C ) ]
8
+ #[ derive( Debug , Copy ) ]
9
+ pub struct _bindgen_ty_1 {
10
+ pub _bitfield_1 : u32 ,
11
+ }
12
+ #[ test]
13
+ fn bindgen_test_layout__bindgen_ty_1 ( ) {
14
+ assert_eq ! ( :: std:: mem:: size_of:: <_bindgen_ty_1>( ) , 4usize ) ;
15
+ assert_eq ! ( :: std:: mem:: align_of:: <_bindgen_ty_1>( ) , 4usize ) ;
16
+ }
17
+ impl Clone for _bindgen_ty_1 {
18
+ fn clone ( & self ) -> Self { * self }
19
+ }
20
+ impl _bindgen_ty_1 {
21
+ #[ inline]
22
+ pub fn pad3 ( & self ) -> :: std:: os:: raw:: c_uint {
23
+ unsafe {
24
+ :: std:: mem:: transmute ( ( ( self . _bitfield_1 & ( 16777215usize as u32 ) )
25
+ >> 0u32 ) as u32 )
26
+ }
27
+ }
28
+ #[ inline]
29
+ pub fn set_pad3 ( & mut self , val : :: std:: os:: raw:: c_uint ) {
30
+ self . _bitfield_1 &= !( 16777215usize as u32 ) ;
31
+ self . _bitfield_1 |=
32
+ ( ( val as u32 as u32 ) << 0u32 ) & ( 16777215usize as u32 ) ;
33
+ }
34
+ #[ inline]
35
+ pub fn type_ ( & self ) -> :: std:: os:: raw:: c_uint {
36
+ unsafe {
37
+ :: std:: mem:: transmute ( ( ( self . _bitfield_1 &
38
+ ( 4278190080usize as u32 ) ) >> 24u32 ) as
39
+ u32 )
40
+ }
41
+ }
42
+ #[ inline]
43
+ pub fn set_type ( & mut self , val : :: std:: os:: raw:: c_uint ) {
44
+ self . _bitfield_1 &= !( 4278190080usize as u32 ) ;
45
+ self . _bitfield_1 |=
46
+ ( ( val as u32 as u32 ) << 24u32 ) & ( 4278190080usize as u32 ) ;
47
+ }
48
+ }
49
+ pub type mach_msg_type_descriptor_t = _bindgen_ty_1 ;
Original file line number Diff line number Diff line change
1
+ typedef struct
2
+ {
3
+ unsigned int pad3 : 24 ;
4
+ unsigned int type : 8 ;
5
+ } mach_msg_type_descriptor_t ;
You can’t perform that action at this time.
0 commit comments