Browse Source

Keep -vet happy

gingerBill 4 years ago
parent
commit
f6e2d74d10

+ 0 - 1
core/io/util.odin

@@ -1,6 +1,5 @@
 package io
 package io
 
 
-import "core:runtime"
 import "core:strconv"
 import "core:strconv"
 
 
 write_u64 :: proc(w: Writer, i: u64, base: int = 10) -> (n: int, err: Error) {
 write_u64 :: proc(w: Writer, i: u64, base: int = 10) -> (n: int, err: Error) {

+ 2 - 2
core/odin/parser/parse_files.odin

@@ -10,8 +10,8 @@ import "core:slice"
 collect_package :: proc(path: string) -> (pkg: ^ast.Package, success: bool) {
 collect_package :: proc(path: string) -> (pkg: ^ast.Package, success: bool) {
 	NO_POS :: tokenizer.Pos{};
 	NO_POS :: tokenizer.Pos{};
 
 
-	pkg_path, ok := filepath.abs(path);
-	if !ok {
+	pkg_path, pkg_path_ok := filepath.abs(path);
+	if !pkg_path_ok {
 		return;
 		return;
 	}
 	}
 
 

+ 4 - 4
core/path/filepath/match.odin

@@ -272,13 +272,13 @@ _glob :: proc(dir, pattern: string, matches: ^[dynamic]string) -> (m: [dynamic]s
 	}
 	}
 	defer os.close(d);
 	defer os.close(d);
 
 
-	fi, ferr := os.fstat(d);
+	file_info, ferr := os.fstat(d);
 	if ferr != 0 {
 	if ferr != 0 {
-		os.file_info_delete(fi);
+		os.file_info_delete(file_info);
 		return;
 		return;
 	}
 	}
-	if !fi.is_dir {
-		os.file_info_delete(fi);
+	if !file_info.is_dir {
+		os.file_info_delete(file_info);
 		return;
 		return;
 	}
 	}
 
 

+ 1 - 2
core/path/filepath/path.odin

@@ -2,7 +2,6 @@
 // To process paths usch as URLs that depend on forward slashes regardless of the OS, use the path package
 // To process paths usch as URLs that depend on forward slashes regardless of the OS, use the path package
 package filepath
 package filepath
 
 
-import "core:os"
 import "core:strings"
 import "core:strings"
 
 
 // is_separator checks whether the byte is a valid separator character
 // is_separator checks whether the byte is a valid separator character
@@ -265,7 +264,7 @@ rel :: proc(base_path, target_path: string, allocator := context.allocator) -> (
 		}
 		}
 		buf := make([]byte, size);
 		buf := make([]byte, size);
 		n := copy(buf, "..");
 		n := copy(buf, "..");
-		for i in 0..<seps {
+		for in 0..<seps {
 			buf[n] = SEPARATOR;
 			buf[n] = SEPARATOR;
 			copy(buf[n+1:], "..");
 			copy(buf[n+1:], "..");
 			n += 3;
 			n += 3;

+ 4 - 3
core/path/filepath/path_windows.odin

@@ -41,7 +41,8 @@ is_abs :: proc(path: string) -> bool {
 		return false;
 		return false;
 	}
 	}
 
 
-	path := path[l:];
+	path := path;
+	path = path[l:];
 	if path == "" {
 	if path == "" {
 		return false;
 		return false;
 	}
 	}
@@ -123,8 +124,8 @@ split_list :: proc(path: string, allocator := context.allocator) -> []string {
 	}
 	}
 	assert(index == count);
 	assert(index == count);
 
 
-	for s, i in list {
-		s, new := strings.replace_all(s, `"`, ``, allocator);
+	for s0, i in list {
+		s, new := strings.replace_all(s0, `"`, ``, allocator);
 		if !new {
 		if !new {
 			s = strings.clone(s, allocator);
 			s = strings.clone(s, allocator);
 		}
 		}