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

all: ~500 more byte=>u8

This commit is contained in:
Alexander Medvednikov
2022-04-15 18:25:45 +03:00
parent ae6a25f44e
commit fbb9e65c0f
148 changed files with 544 additions and 494 deletions

View File

@@ -100,15 +100,15 @@ fn sub96(s2 u32, s1 u32, s0 u32, d2 u32, d1 u32, d0 u32) (u32, u32, u32) {
}
// Utility functions
fn is_digit(x byte) bool {
fn is_digit(x u8) bool {
return (x >= strconv.c_zero && x <= strconv.c_nine) == true
}
fn is_space(x byte) bool {
fn is_space(x u8) bool {
return x == `\t` || x == `\n` || x == `\v` || x == `\f` || x == `\r` || x == ` `
}
fn is_exp(x byte) bool {
fn is_exp(x u8) bool {
return (x == `E` || x == `e`) == true
}

View File

@@ -12,7 +12,7 @@ const (
max_u64 = u64(18446744073709551615) // as u64 // use this until we add support
)
pub fn byte_to_lower(c byte) byte {
pub fn byte_to_lower(c u8) u8 {
return c | (`x` - `X`)
}

View File

@@ -80,7 +80,7 @@ Single format functions
*/
pub struct BF_param {
pub mut:
pad_ch byte = u8(` `) // padding char
pad_ch u8 = u8(` `) // padding char
len0 int = -1 // default len for whole the number or string
len1 int = 6 // number of decimal digits, if needed
positive bool = true // mandatory: the sign of the number passed

View File

@@ -76,7 +76,7 @@ pub fn format_dec_sb(d u64, p BF_param, mut res strings.Builder) {
// Legacy version
// max u64 18446744073709551615 => 20 byte
mut buf := [32]byte{}
mut buf := [32]u8{}
mut i := 20
mut d1 := d
for i >= (21 - n_char) {