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

tools: make v test-cleancode test everything by default (#10050)

This commit is contained in:
Delyan Angelov
2021-05-08 13:32:29 +03:00
committed by GitHub
parent cba2cb6b9c
commit 8a380f4699
132 changed files with 3230 additions and 3440 deletions

View File

@ -1,2 +1,2 @@
//this keeps vfmt happy
// this keeps vfmt happy
module os2

View File

@ -1,30 +1,26 @@
module os2
#include <fcntl.h>
struct File {
fd int
}
fn C.perror(charptr)
fn C.perror(&char)
fn C.open(&byte, int, int) int
fn C.open(byteptr, int, int) int
fn C.write(voidptr, byteptr, int) int
fn C.write(voidptr, &byte, int) int
fn C.close(int) int
pub fn create(path string) ?File {
fd := C.open(path.str, C.O_CREAT | C.O_TRUNC | C.O_WRONLY, 0644) // 511
fd := C.open(path.str, C.O_CREAT | C.O_TRUNC | C.O_WRONLY, o644) // 511
if fd == -1 {
return error('failed to create "$path":')
// os.print_c_errno()
}
return File{
fd}
return File{fd}
}
pub fn (f File) writeln(s string) {

View File

@ -1,4 +1,4 @@
//import os2
// import os2
fn test_open() {
/*
@ -8,4 +8,4 @@ fn test_open() {
f.close()
}
*/
}
}