ci: fix failing `v -W build-tools` and `v -W build-examples`; run vfmt.
parent
ea3d1405ee
commit
04095f4088
|
@ -131,11 +131,11 @@ fn main() {
|
|||
max_bname := context.max_bname_len(file_byte_map.keys())
|
||||
if context.write_file.len > 0 {
|
||||
mut out_file := os.create(context.write_file) ?
|
||||
out_file.write_str(context.header()) ?
|
||||
out_file.write_string(context.header()) ?
|
||||
for bname, fbytes in file_byte_map {
|
||||
out_file.write_str(context.file2v(bname, fbytes, max_bname)) ?
|
||||
out_file.write_string(context.file2v(bname, fbytes, max_bname)) ?
|
||||
}
|
||||
out_file.write_str(context.footer()) ?
|
||||
out_file.write_string(context.footer()) ?
|
||||
} else {
|
||||
print(context.header())
|
||||
for bname, fbytes in file_byte_map {
|
||||
|
|
|
@ -77,7 +77,7 @@ fn (c &Create) write_vmod(new bool) {
|
|||
cerror(err.msg)
|
||||
exit(1)
|
||||
}
|
||||
vmod.write_str(vmod_content(c)) or { panic(err) }
|
||||
vmod.write_string(vmod_content(c)) or { panic(err) }
|
||||
vmod.close()
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ fn (c &Create) write_main(new bool) {
|
|||
cerror(err.msg)
|
||||
exit(2)
|
||||
}
|
||||
mainfile.write_str(main_content()) or { panic(err) }
|
||||
mainfile.write_string(main_content()) or { panic(err) }
|
||||
mainfile.close()
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ fn (c &Create) create_git_repo(dir string) {
|
|||
// We don't really need a .gitignore, it's just a nice-to-have
|
||||
return
|
||||
}
|
||||
fl.write_str(gen_gitignore(c.name)) or { panic(err) }
|
||||
fl.write_string(gen_gitignore(c.name)) or { panic(err) }
|
||||
fl.close()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ const (
|
|||
vet_folders = [
|
||||
'vlib/sqlite',
|
||||
'vlib/v',
|
||||
'vlib/x/ttf/',
|
||||
'cmd/v',
|
||||
'cmd/tools',
|
||||
'examples/2048',
|
||||
|
|
|
@ -7,7 +7,7 @@ fn main() {
|
|||
// Make a new connection
|
||||
mut conn := net.dial_tcp('google.com:80') ?
|
||||
// Simple http HEAD request for a file
|
||||
conn.write_str('GET /index.html HTTP/1.0\r\n\r\n') ?
|
||||
conn.write_string('GET /index.html HTTP/1.0\r\n\r\n') ?
|
||||
// Wrap in a buffered reader
|
||||
mut r := io.new_buffered_reader(reader: io.make_reader(conn))
|
||||
for {
|
||||
|
|
|
@ -8,7 +8,7 @@ fn main() {
|
|||
conn.close() or {}
|
||||
}
|
||||
// Simple http HEAD request for a file
|
||||
conn.write_str('HEAD /index.html HTTP/1.0\r\n\r\n') ?
|
||||
conn.write_string('HEAD /index.html HTTP/1.0\r\n\r\n') ?
|
||||
// Read all the data that is waiting
|
||||
result := io.read_all(reader: conn) ?
|
||||
// Cast to string and print result
|
||||
|
|
|
@ -106,7 +106,7 @@ fn (image Image) save_as_ppm(file_name string) {
|
|||
c_r := to_int(unsafe { image.data[i] }.x)
|
||||
c_g := to_int(unsafe { image.data[i] }.y)
|
||||
c_b := to_int(unsafe { image.data[i] }.z)
|
||||
f_out.write_str('$c_r $c_g $c_b ') or { panic(err) }
|
||||
f_out.write_string('$c_r $c_g $c_b ') or { panic(err) }
|
||||
}
|
||||
f_out.close()
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ pub fn (mut bmp BitMap) save_as_ppm(file_name string) {
|
|||
c_r := bmp.buf[pos]
|
||||
c_g := bmp.buf[pos + 1]
|
||||
c_b := bmp.buf[pos + 2]
|
||||
f_out.write_str('$c_r $c_g $c_b ') or { panic(err) }
|
||||
f_out.write_string('$c_r $c_g $c_b ') or { panic(err) }
|
||||
}
|
||||
}
|
||||
f_out.close()
|
||||
|
|
|
@ -800,8 +800,8 @@ pub fn (mut bmp BitMap) draw_glyph(index u16) (int, int) {
|
|||
|
||||
// bmp.line(x0, y0, start_point.x, start_point.y, u32(0x00FF0000)
|
||||
// u32(0xFF000000))
|
||||
bmp.quadratic(x0, y0, start_point.x, start_point.y, (point.x +
|
||||
start_point.x) / 2, (point.y + start_point.y) / 2, color)
|
||||
bmp.quadratic(x0, y0, start_point.x, start_point.y, (point.x + start_point.x) / 2,
|
||||
(point.y + start_point.y) / 2, color)
|
||||
}
|
||||
} else {
|
||||
// last point not in a curve
|
||||
|
|
|
@ -519,8 +519,8 @@ fn (mut tf TTF_File) get_fword() i16 {
|
|||
}
|
||||
|
||||
fn (mut tf TTF_File) get_u32() u32 {
|
||||
x := (u32(tf.buf[tf.pos]) << u32(24)) | (u32(tf.buf[tf.pos +
|
||||
1]) << u32(16)) | (u32(tf.buf[tf.pos + 2]) << u32(8)) | u32(tf.buf[tf.pos + 3])
|
||||
x := (u32(tf.buf[tf.pos]) << u32(24)) | (u32(tf.buf[tf.pos + 1]) << u32(16)) | (u32(tf.buf[
|
||||
tf.pos + 2]) << u32(8)) | u32(tf.buf[tf.pos + 3])
|
||||
tf.pos += 4
|
||||
return x
|
||||
}
|
||||
|
|
|
@ -183,7 +183,7 @@ fn test_main() {
|
|||
|
||||
mut bmp := ttf.BitMap{
|
||||
tf: &tf
|
||||
buf: malloc(sz)
|
||||
buf: unsafe { malloc(sz) }
|
||||
buf_size: sz
|
||||
scale: scale
|
||||
width: w
|
||||
|
|
Loading…
Reference in New Issue