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

all: replace []byte with []u8

This commit is contained in:
Alexander Medvednikov
2022-04-15 15:35:35 +03:00
parent 0527ac633e
commit fb192d949b
164 changed files with 533 additions and 533 deletions

View File

@@ -114,8 +114,8 @@ pub fn (mut bmp BitMap) save_as_ppm(file_name string) {
bmp.buf = tmp_buf
}
pub fn (mut bmp BitMap) get_raw_bytes() []byte {
mut f_buf := []byte{len: bmp.buf_size / 4}
pub fn (mut bmp BitMap) get_raw_bytes() []u8 {
mut f_buf := []u8{len: bmp.buf_size / 4}
mut i := 0
for i < bmp.buf_size {
unsafe {

View File

@@ -45,7 +45,7 @@ mut:
******************************************************************************/
pub struct TTF_File {
pub mut:
buf []byte
buf []u8
pos u32
length u16
scalar_type u32
@@ -319,7 +319,7 @@ fn (mut tf TTF_File) read_simple_glyph(mut in_glyph Glyph) {
num_points++
mut i := 0
mut flags := []byte{}
mut flags := []u8{}
for i < num_points {
flag := tf.get_u8()
flags << flag

View File

@@ -151,7 +151,7 @@ ffbf ffff bf00 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
'
fn save_raw_data_as_array(buf_bin []byte, file_name string) {
fn save_raw_data_as_array(buf_bin []u8, file_name string) {
mut buf := strings.new_builder(buf_bin.len * 5)
for x in buf_bin {
buf.write_string('0x${x:02x},')
@@ -212,8 +212,8 @@ fn test_main() {
}
}
fn get_raw_data(data string) []byte {
mut buf := []byte{}
fn get_raw_data(data string) []u8 {
mut buf := []u8{}
mut c := 0
mut b := u32(0)
for ch in data {