Browse Source

Fix typos and make demo work with -vet

gingerBill 5 years ago
parent
commit
1b8c3ca22a
5 changed files with 10 additions and 9 deletions
  1. 2 2
      core/fmt/fmt.odin
  2. 3 3
      core/strings/strings.odin
  3. 0 1
      examples/demo/demo.odin
  4. 4 2
      src/check_type.cpp
  5. 1 1
      src/parser.cpp

+ 2 - 2
core/fmt/fmt.odin

@@ -69,8 +69,8 @@ eprintf  :: proc(fmt: string, args: ..any) -> int { return fprintf(context.stder
 
 
 
 
 @(deprecated="prefer eprint")   print_err   :: proc(args: ..any)              -> int { return eprint(..args); }
 @(deprecated="prefer eprint")   print_err   :: proc(args: ..any)              -> int { return eprint(..args); }
-@(deprecated="prefer eprintf")  println_err :: proc(args: ..any)              -> int { return eprintln(..args); }
-@(deprecated="prefer eprintln") printf_err  :: proc(fmt: string, args: ..any) -> int { return eprintf(fmt, ..args); }
+@(deprecated="prefer eprintf")  printf_err  :: proc(fmt: string, args: ..any) -> int { return eprintf(fmt, ..args); }
+@(deprecated="prefer eprintln") println_err :: proc(args: ..any)              -> int { return eprintln(..args); }
 
 
 
 
 // aprint* procedures return a string that was allocated with the current context
 // aprint* procedures return a string that was allocated with the current context

+ 3 - 3
core/strings/strings.odin

@@ -169,9 +169,9 @@ _split :: proc(s_, sep: string, sep_save, n_: int, allocator := context.allocato
 			n = l;
 			n = l;
 		}
 		}
 
 
-		res := make([dynamic]string, n);
+		res := make([dynamic]string, n, allocator);
 		for i := 0; i < n-1; i += 1 {
 		for i := 0; i < n-1; i += 1 {
-			r, w := utf8.decode_rune_in_string(s);
+			_, w := utf8.decode_rune_in_string(s);
 			res[i] = s[:w];
 			res[i] = s[:w];
 			s = s[w:];
 			s = s[w:];
 		}
 		}
@@ -185,7 +185,7 @@ _split :: proc(s_, sep: string, sep_save, n_: int, allocator := context.allocato
 		n = count(s, sep) + 1;
 		n = count(s, sep) + 1;
 	}
 	}
 
 
-	res := make([dynamic]string, n);
+	res := make([dynamic]string, n, allocator);
 
 
 	n -= 1;
 	n -= 1;
 
 

+ 0 - 1
examples/demo/demo.odin

@@ -4,7 +4,6 @@ import "core:fmt"
 import "core:mem"
 import "core:mem"
 import "core:os"
 import "core:os"
 import "core:reflect"
 import "core:reflect"
-import "core:strings"
 import "intrinsics"
 import "intrinsics"
 
 
 when os.OS == "windows" {
 when os.OS == "windows" {

+ 4 - 2
src/check_type.cpp

@@ -2016,8 +2016,10 @@ Type *type_to_abi_compat_result_type(gbAllocator a, Type *original_type, ProcCal
 			break;
 			break;
 		}
 		}
 		}
 		}
-	} else if (build_context.ODIN_OS == "linux") {
-
+	} else if (build_context.ODIN_OS == "linux" || build_context.ODIN_OS == "darwin") {
+		if (build_context.ODIN_ARCH == "amd64") {
+			
+		}
 	} else {
 	} else {
 		// IMPORTANT TODO(bill): figure out the ABI settings for Linux, OSX etc. for
 		// IMPORTANT TODO(bill): figure out the ABI settings for Linux, OSX etc. for
 		// their architectures
 		// their architectures

+ 1 - 1
src/parser.cpp

@@ -1345,7 +1345,7 @@ bool is_semicolon_optional_for_node(AstFile *f, Ast *s) {
 	case Ast_EnumType:
 	case Ast_EnumType:
 	case Ast_BitFieldType:
 	case Ast_BitFieldType:
 		// Require semicolon within a procedure body
 		// Require semicolon within a procedure body
-		return f->curr_proc == false;
+		return f->curr_proc == nullptr;
 	case Ast_ProcLit:
 	case Ast_ProcLit:
 		return true;
 		return true;