File tree Expand file tree Collapse file tree 4 files changed +6
-14
lines changed Expand file tree Collapse file tree 4 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -1038,7 +1038,7 @@ pub fn last_error() IError {
1038
1038
}
1039
1039
1040
1040
// Magic constant because zero is used explicitly at times
1041
- pub const error_code_not_set = 0x7EFEFEFE
1041
+ pub const error_code_not_set = int ( 0x7EFEFEFE )
1042
1042
1043
1043
@[params]
1044
1044
pub struct SystemError {
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) {
169
169
if v.pref.os == .macos && os.exists ('/opt/procursus' ) {
170
170
ccoptions.linker_flags << '-Wl,-rpath,/opt/procursus/lib'
171
171
}
172
- mut user_darwin_version := 999_999_999
172
+ mut user_darwin_version := 999_999
173
173
mut user_darwin_ppc := false
174
174
$if macos {
175
175
user_darwin_version = os.uname ().release.split ('.' )[0 ].int ()
Original file line number Diff line number Diff line change @@ -211,12 +211,8 @@ fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) {
211
211
}
212
212
if left_type == ast.int_type {
213
213
if mut right is ast.IntegerLiteral {
214
- mut is_large := right.val.len > 13
215
- if ! is_large && right.val.len > 9 {
216
- val := right.val.i64 ()
217
- is_large = overflows_i32 (val)
218
- }
219
- if is_large {
214
+ val := right.val.i64 ()
215
+ if overflows_i32 (val) {
220
216
c.error ('overflow in implicit type `int`, use explicit type casting instead' ,
221
217
right.pos)
222
218
}
Original file line number Diff line number Diff line change @@ -1789,12 +1789,8 @@ fn (mut c Checker) const_decl(mut node ast.ConstDecl) {
1789
1789
// Check for int overflow
1790
1790
if field.typ == ast.int_type {
1791
1791
if mut field.expr is ast.IntegerLiteral {
1792
- mut is_large := field.expr.val.len > 13
1793
- if ! is_large && field.expr.val.len > 9 {
1794
- val := field.expr.val.i64 ()
1795
- is_large = overflows_i32 (val)
1796
- }
1797
- if is_large {
1792
+ val := field.expr.val.i64 ()
1793
+ if overflows_i32 (val) {
1798
1794
c.error ('overflow in implicit type `int`, use explicit type casting instead' ,
1799
1795
field.expr.pos)
1800
1796
}
You can’t perform that action at this time.
0 commit comments