1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

disable u32 check for now

This commit is contained in:
Alexander Medvednikov 2019-07-10 22:05:50 +02:00
parent 892d2b58ac
commit 4a8ba9756f
2 changed files with 7 additions and 6 deletions

View File

@ -644,7 +644,7 @@ fn is_valid_int_const(val, typ string) bool {
switch typ { switch typ {
case 'byte', 'u8': return 0 <= x && x <= math.MaxU8 case 'byte', 'u8': return 0 <= x && x <= math.MaxU8
case 'u16': return 0 <= x && x <= math.MaxU16 case 'u16': return 0 <= x && x <= math.MaxU16
case 'u32': return 0 <= x && x <= math.MaxU32 //case 'u32': return 0 <= x && x <= math.MaxU32
//case 'u64': return 0 <= x && x <= math.MaxU64 //case 'u64': return 0 <= x && x <= math.MaxU64
////////////// //////////////
case 'i8': return math.MinI8 <= x && x <= math.MaxI8 case 'i8': return math.MinI8 <= x && x <= math.MaxI8

View File

@ -7,7 +7,7 @@ mut:
field []u32 field []u32
} }
/* helper functions */ // helper functions
const ( const (
SLOT_SIZE = 32 SLOT_SIZE = 32
) )
@ -55,14 +55,14 @@ fn bitnslots(length int) int {
fn cleartail(instance BitField) { fn cleartail(instance BitField) {
tail := instance.size % SLOT_SIZE tail := instance.size % SLOT_SIZE
if tail != 0 { if tail != 0 {
/* create a mask for the tail */ // create a mask for the tail
mask := u32((1 << tail) - 1) mask := u32((1 << tail) - 1)
/* clear the extra bits */ // clear the extra bits
instance.field[bitnslots(instance.size) - 1] = instance.field[bitnslots(instance.size) - 1] & mask instance.field[bitnslots(instance.size) - 1] = instance.field[bitnslots(instance.size) - 1] & mask
} }
} }
/* public functions */ // public functions
pub fn new(size int) BitField { pub fn new(size int) BitField {
output := BitField{ output := BitField{
@ -177,3 +177,4 @@ pub fn clone(input BitField) BitField {
} }
return output return output
} }