From 65126efdc3e1d5843faa359f27d69a42baa3e305 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 28 Jul 2021 22:35:51 +0300 Subject: [PATCH] builtin: remove u8 for now --- vlib/builtin/string_interpolation.v | 4 ++-- vlib/v/gen/c/str_intp.v | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vlib/builtin/string_interpolation.v b/vlib/builtin/string_interpolation.v index 9d00ab94be..10064ac6ea 100644 --- a/vlib/builtin/string_interpolation.v +++ b/vlib/builtin/string_interpolation.v @@ -119,7 +119,7 @@ fn abs64(x i64) u64 { //========================================= // convert from data format to compact u64 -pub fn get_str_intp_u64_format(fmt_type StrIntpType, in_width int, in_precision int, in_tail_zeros bool, in_sign bool, in_pad_ch u8, in_base int, in_upper_case bool) u64 { +pub fn get_str_intp_u64_format(fmt_type StrIntpType, in_width int, in_precision int, in_tail_zeros bool, in_sign bool, in_pad_ch byte, in_base int, in_upper_case bool) u64 { width := if in_width != 0 { abs64(in_width) } else { u64(0) } allign := if in_width > 0 { u64(1 << 5) } else { u64(0) } // two bit 0 .left 1 .rigth, for now we use only one upper_case := if in_upper_case { u64(1 << 7) } else { u64(0) } @@ -136,7 +136,7 @@ pub fn get_str_intp_u64_format(fmt_type StrIntpType, in_width int, in_precision } // convert from data format to compact u32 -pub fn get_str_intp_u32_format(fmt_type StrIntpType, in_width int, in_precision int, in_tail_zeros bool, in_sign bool, in_pad_ch u8, in_base int, in_upper_case bool) u32 { +pub fn get_str_intp_u32_format(fmt_type StrIntpType, in_width int, in_precision int, in_tail_zeros bool, in_sign bool, in_pad_ch byte, in_base int, in_upper_case bool) u32 { width := if in_width != 0 { abs64(in_width) } else { u32(0) } allign := if in_width > 0 { u32(1 << 5) } else { u32(0) } // two bit 0 .left 1 .rigth, for now we use only one upper_case := if in_upper_case { u32(1 << 7) } else { u32(0) } diff --git a/vlib/v/gen/c/str_intp.v b/vlib/v/gen/c/str_intp.v index 68e5830581..7ace443a12 100644 --- a/vlib/v/gen/c/str_intp.v +++ b/vlib/v/gen/c/str_intp.v @@ -110,7 +110,7 @@ fn (mut g Gen) str_format(node ast.StringInterLiteral, i int) (u64, string) { pad_ch = 1 } res := get_str_intp_u32_format(fmt_type, node.fwidths[i], node.precisions[i], remove_tail_zeros, - node.pluss[i], pad_ch, base, upper_case) + node.pluss[i], byte(pad_ch), base, upper_case) // return res, fmt_type.str() }