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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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`)
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user