From 4a8ba9756fb6c750b3fd27f88f05925175ab765c Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 10 Jul 2019 22:05:50 +0200 Subject: [PATCH] disable u32 check for now --- compiler/table.v | 2 +- vlib/bf/bf.v | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/compiler/table.v b/compiler/table.v index 82a49b1a06..45c66e8f24 100644 --- a/compiler/table.v +++ b/compiler/table.v @@ -644,7 +644,7 @@ fn is_valid_int_const(val, typ string) bool { switch typ { case 'byte', 'u8': return 0 <= x && x <= math.MaxU8 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 'i8': return math.MinI8 <= x && x <= math.MaxI8 diff --git a/vlib/bf/bf.v b/vlib/bf/bf.v index 585a1be24c..e5fed64c08 100644 --- a/vlib/bf/bf.v +++ b/vlib/bf/bf.v @@ -7,7 +7,7 @@ mut: field []u32 } -/* helper functions */ +// helper functions const ( SLOT_SIZE = 32 ) @@ -55,14 +55,14 @@ fn bitnslots(length int) int { fn cleartail(instance BitField) { tail := instance.size % SLOT_SIZE if tail != 0 { - /* create a mask for the tail */ + // create a mask for the tail 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 } } -/* public functions */ +// public functions pub fn new(size int) BitField { output := BitField{ @@ -176,4 +176,5 @@ pub fn clone(input BitField) BitField { i++ } return output -} \ No newline at end of file +} +