mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fix i64 overflow warning
This commit is contained in:

committed by
Alexander Medvednikov

parent
ef71867bb0
commit
c8de2c0bd4
@ -41,7 +41,10 @@ pub const (
|
||||
min_i16 = -32768
|
||||
max_i32 = 2147483647
|
||||
min_i32 = -2147483648
|
||||
min_i64 = -9223372036854775808
|
||||
// -9223372036854775808 is wrong because C compilers parse litteral values
|
||||
// without sign first, and 9223372036854775808 overflows i64, hence the
|
||||
// consecutive subtraction by 1
|
||||
min_i64 = -9223372036854775807 - 1
|
||||
max_i64 = 9223372036854775807
|
||||
max_u8 = 255
|
||||
max_u16 = 65535
|
||||
|
Reference in New Issue
Block a user