mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v test-cleancode: ensure more .v files are kept vmft-ed
This commit is contained in:
@ -65,7 +65,7 @@ fn (nn int) str_l(max int) string {
|
||||
if n == 0 {
|
||||
return '0'
|
||||
}
|
||||
mut buf := unsafe {malloc(max + 1)}
|
||||
mut buf := unsafe { malloc(max + 1) }
|
||||
mut is_neg := false
|
||||
if n < 0 {
|
||||
n = -n
|
||||
@ -136,7 +136,7 @@ pub fn (nn u32) str() string {
|
||||
return '0'
|
||||
}
|
||||
max := 12
|
||||
mut buf := unsafe {malloc(max + 1)}
|
||||
mut buf := unsafe { malloc(max + 1) }
|
||||
mut index := max
|
||||
unsafe {
|
||||
buf[index--] = `\0`
|
||||
@ -283,7 +283,7 @@ fn u64_to_hex(nn u64, len byte) string {
|
||||
n = n >> 4
|
||||
}
|
||||
return string{
|
||||
str: unsafe {memdup(buf, len + 1)}
|
||||
str: unsafe { memdup(buf, len + 1) }
|
||||
len: len
|
||||
}
|
||||
}
|
||||
@ -306,7 +306,7 @@ fn u64_to_hex_no_leading_zeros(nn u64, len byte) string {
|
||||
}
|
||||
res_len := len - i
|
||||
return string{
|
||||
str: unsafe {memdup(&buf[i], res_len + 1)}
|
||||
str: unsafe { memdup(&buf[i], res_len + 1) }
|
||||
len: res_len
|
||||
}
|
||||
}
|
||||
@ -448,7 +448,7 @@ pub fn (b byte) str() string {
|
||||
// Example: assert byte(97).ascii_str() == 'a'
|
||||
pub fn (b byte) ascii_str() string {
|
||||
mut str := string{
|
||||
str: unsafe {malloc(2)}
|
||||
str: unsafe { malloc(2) }
|
||||
len: 1
|
||||
}
|
||||
unsafe {
|
||||
|
Reference in New Issue
Block a user