👍 Fix up redundant type declare and remove space (#603)
parent
32e61b23d0
commit
61e4367aa8
|
@ -15,7 +15,7 @@ pub:
|
|||
}
|
||||
|
||||
// Private function, used by V (`nums := []int`)
|
||||
fn new_array(mylen int, cap, elm_size int) array {
|
||||
fn new_array(mylen, cap, elm_size int) array {
|
||||
arr := array {
|
||||
len: mylen
|
||||
cap: cap
|
||||
|
@ -50,7 +50,7 @@ fn new_array_from_c_array_no_alloc(len, cap, elm_size int, c_array voidptr) arra
|
|||
}
|
||||
|
||||
// Private function, used by V (`[0; 100]`)
|
||||
fn array_repeat(val voidptr, nr_repeats int, elm_size int) array {
|
||||
fn array_repeat(val voidptr, nr_repeats, elm_size int) array {
|
||||
arr := array {
|
||||
len: nr_repeats
|
||||
cap: nr_repeats
|
||||
|
|
|
@ -25,7 +25,7 @@ pub:
|
|||
// next *Entry
|
||||
}
|
||||
|
||||
fn new_map(cap int, elm_size int) map {
|
||||
fn new_map(cap, elm_size int) map {
|
||||
res := map {
|
||||
// len: len,
|
||||
element_size: elm_size
|
||||
|
|
|
@ -164,7 +164,7 @@ fn (table &Table) known_pkg(pkg string) bool {
|
|||
return pkg in table.packages
|
||||
}
|
||||
|
||||
fn (t mut Table) register_const(name, typ string, pkg string, is_imported bool) {
|
||||
fn (t mut Table) register_const(name, typ, pkg string, is_imported bool) {
|
||||
t.consts << Var {
|
||||
name: name
|
||||
typ: typ
|
||||
|
|
|
@ -267,7 +267,7 @@ fn (g &Game) draw_tetro() {
|
|||
}
|
||||
}
|
||||
|
||||
fn (g &Game) draw_block(i, j int, color_idx int) {
|
||||
fn (g &Game) draw_block(i, j, color_idx int) {
|
||||
g.gg.draw_rect((j - 1) * BlockSize, (i - 1) * BlockSize,
|
||||
BlockSize - 1, BlockSize - 1, Colors[color_idx])
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ fn parse_binary_tetro(t int) []Block {
|
|||
}
|
||||
|
||||
// TODO: this exposes the unsafe C interface, clean up
|
||||
fn key_down(wnd voidptr, key int, code int, action, mods int) {
|
||||
fn key_down(wnd voidptr, key, code, action, mods int) {
|
||||
if action != 2 && action != 1 {
|
||||
return
|
||||
}
|
||||
|
|
8
gl/gl.v
8
gl/gl.v
|
@ -28,7 +28,7 @@ fn init_glad() {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn viewport(a int, b int, c int, d int) {
|
||||
pub fn viewport(a, b, c, d int) {
|
||||
C.glViewport(a, b, c, d)
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ pub fn create_program() int {
|
|||
return C.glCreateProgram()
|
||||
}
|
||||
|
||||
pub fn shader_source(shader int, a int, source string, b int) {
|
||||
pub fn shader_source(shader, a int, source string, b int) {
|
||||
C.glShaderSource(shader, a, &source.str, b)
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ pub fn shader_compile_status(shader int) int {
|
|||
return success
|
||||
}
|
||||
|
||||
pub fn attach_shader(program int, shader int) {
|
||||
pub fn attach_shader(program, shader int) {
|
||||
// fn (s Shader) attach(program int) {
|
||||
C.glAttachShader(program, shader)
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ pub fn delete_texture(texture u32) {
|
|||
C.glDeleteTextures(1, &texture)
|
||||
}
|
||||
|
||||
pub fn buffer_data(typ int, size int, arr voidptr, draw_typ int) {
|
||||
pub fn buffer_data(typ, size int, arr voidptr, draw_typ int) {
|
||||
C.glBufferData(typ, size, arr, draw_typ)
|
||||
}
|
||||
|
||||
|
|
4
os/os.v
4
os/os.v
|
@ -202,7 +202,7 @@ fn open_file_a(file string) File {
|
|||
return create_file2(file, 'a')
|
||||
}
|
||||
|
||||
fn create_file2(file string, mode string) File {
|
||||
fn create_file2(file, mode string) File {
|
||||
res := File {
|
||||
cfile: C.fopen(file.cstr(), mode.cstr())
|
||||
}
|
||||
|
@ -370,7 +370,7 @@ pub fn rm(path string) {
|
|||
|
||||
/*
|
||||
// TODO
|
||||
fn rmdir(path string, guard string) {
|
||||
fn rmdir(path, guard string) {
|
||||
if !path.contains(guard) {
|
||||
println('rmdir canceled because the path doesnt contain $guard')
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue