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

all: replace generic <> with [] - part 2 (#16536)

This commit is contained in:
yuyi
2022-11-27 00:23:26 +08:00
committed by GitHub
parent b19b97e7b1
commit ef5be22f81
297 changed files with 1959 additions and 1943 deletions

View File

@ -588,7 +588,7 @@ fn error_size_of_type_0() IError {
}
// read_struct reads a single struct of type `T`
pub fn (mut f File) read_struct<T>(mut t T) ! {
pub fn (mut f File) read_struct[T](mut t T) ! {
if !f.is_opened {
return error_file_not_opened()
}
@ -603,7 +603,7 @@ pub fn (mut f File) read_struct<T>(mut t T) ! {
}
// read_struct_at reads a single struct of type `T` at position specified in file
pub fn (mut f File) read_struct_at<T>(mut t T, pos u64) ! {
pub fn (mut f File) read_struct_at[T](mut t T, pos u64) ! {
if !f.is_opened {
return error_file_not_opened()
}
@ -634,7 +634,7 @@ pub fn (mut f File) read_struct_at<T>(mut t T, pos u64) ! {
}
// read_raw reads and returns a single instance of type `T`
pub fn (mut f File) read_raw<T>() !T {
pub fn (mut f File) read_raw[T]() !T {
if !f.is_opened {
return error_file_not_opened()
}
@ -651,7 +651,7 @@ pub fn (mut f File) read_raw<T>() !T {
}
// read_raw_at reads and returns a single instance of type `T` starting at file byte offset `pos`
pub fn (mut f File) read_raw_at<T>(pos u64) !T {
pub fn (mut f File) read_raw_at[T](pos u64) !T {
if !f.is_opened {
return error_file_not_opened()
}
@ -697,7 +697,7 @@ pub fn (mut f File) read_raw_at<T>(pos u64) !T {
}
// write_struct writes a single struct of type `T`
pub fn (mut f File) write_struct<T>(t &T) ! {
pub fn (mut f File) write_struct[T](t &T) ! {
if !f.is_opened {
return error_file_not_opened()
}
@ -716,7 +716,7 @@ pub fn (mut f File) write_struct<T>(t &T) ! {
}
// write_struct_at writes a single struct of type `T` at position specified in file
pub fn (mut f File) write_struct_at<T>(t &T, pos u64) ! {
pub fn (mut f File) write_struct_at[T](t &T, pos u64) ! {
if !f.is_opened {
return error_file_not_opened()
}
@ -753,7 +753,7 @@ pub fn (mut f File) write_struct_at<T>(t &T, pos u64) ! {
// TODO `write_raw[_at]` implementations are copy-pasted from `write_struct[_at]`
// write_raw writes a single instance of type `T`
pub fn (mut f File) write_raw<T>(t &T) ! {
pub fn (mut f File) write_raw[T](t &T) ! {
if !f.is_opened {
return error_file_not_opened()
}
@ -772,7 +772,7 @@ pub fn (mut f File) write_raw<T>(t &T) ! {
}
// write_raw_at writes a single instance of type `T` starting at file byte offset `pos`
pub fn (mut f File) write_raw_at<T>(t &T, pos u64) ! {
pub fn (mut f File) write_raw_at[T](t &T, pos u64) ! {
if !f.is_opened {
return error_file_not_opened()
}