File tree Expand file tree Collapse file tree 5 files changed +37
-7
lines changed Expand file tree Collapse file tree 5 files changed +37
-7
lines changed Original file line number Diff line number Diff line change 1+ // bindgen-flags: --allowlist-var "val[0-9]+"
2+
3+ #include <stdint.h>
4+
5+ static const uint32_t val1 = 0x7fffffff ;
6+ static const uint32_t val2 = 0x80000000 ;
7+ static const uint32_t val3 = 0xffffffff ;
8+ static const uint64_t val4 = 0x7fffffffffffffff ;
9+ static const uint64_t val5 = 0x8000000000000000 ;
10+ static const uint64_t val6 = 0xffffffffffffffff ;
11+
12+ static const uint32_t val7 = (0x7fffffff );
13+ static const uint32_t val8 = (0x80000000 );
14+ static const uint32_t val9 = (0xffffffff );
15+ static const uint64_t val10 = (0x7fffffffffffffff );
16+ static const uint64_t val11 = (0x8000000000000000 );
17+ static const uint64_t val12 = (0xffffffffffffffff );
18+
19+ static const uint64_t val13 = (uint64_t )UINT64_MAX ;
20+ static const uint64_t val14 = (uint64_t )0xffffffffffffffff ;
Original file line number Diff line number Diff line change @@ -2351,7 +2351,7 @@ impl EvalResult {
23512351
23522352 if unsafe { clang_EvalResult_isUnsignedInt ( self . x ) } != 0 {
23532353 let value = unsafe { clang_EvalResult_getAsUnsigned ( self . x ) } ;
2354- if value > i64 :: MAX as c_ulonglong {
2354+ if value > u64 :: MAX as c_ulonglong {
23552355 return None ;
23562356 }
23572357
Original file line number Diff line number Diff line change @@ -120,9 +120,4 @@ impl IntKind {
120120 _ => return None ,
121121 } )
122122 }
123-
124- /// Whether this type's signedness matches the value.
125- pub ( crate ) fn signedness_matches ( & self , val : i64 ) -> bool {
126- val >= 0 || self . is_signed ( )
127- }
128123}
Original file line number Diff line number Diff line change @@ -341,7 +341,7 @@ impl ClangSubItemParser for Var {
341341 } ;
342342
343343 let mut val = cursor. evaluate ( ) . and_then ( |v| v. as_int ( ) ) ;
344- if val. is_none ( ) || !kind . signedness_matches ( val . unwrap ( ) ) {
344+ if val. is_none ( ) {
345345 val = get_integer_literal_from_cursor ( & cursor) ;
346346 }
347347
You can’t perform that action at this time.
0 commit comments