Browse Source

Merge pull request #2013 from kevinsjoberg/fix-odinfmt-build-errors

Fix odinfmt build errors
Jeroen van Rijn 2 years ago
parent
commit
eb5456f9c7
2 changed files with 2 additions and 2 deletions
  1. 1 1
      tools/odinfmt/flag/flag.odin
  2. 1 1
      tools/odinfmt/main.odin

+ 1 - 1
tools/odinfmt/flag/flag.odin

@@ -146,7 +146,7 @@ reflect_args_structure :: proc(ctx: ^Flag_Context, v: any) -> Flag_Error {
 		type := types[i];
 		type := types[i];
 
 
 		if named_type, ok := type.variant.(Type_Info_Named); ok {
 		if named_type, ok := type.variant.(Type_Info_Named); ok {
-			if union_type, ok := named_type.base.variant.(Type_Info_Union); ok && union_type.maybe && len(union_type.variants) == 1 {
+			if union_type, ok := named_type.base.variant.(Type_Info_Union); ok && len(union_type.variants) == 1 {
 				flag.optional = true;
 				flag.optional = true;
 				flag.tag_ptr = rawptr(uintptr(union_type.tag_offset) + uintptr(v.data) + uintptr(offsets[i]));
 				flag.tag_ptr = rawptr(uintptr(union_type.tag_offset) + uintptr(v.data) + uintptr(offsets[i]));
 				type = union_type.variants[0];
 				type = union_type.variants[0];

+ 1 - 1
tools/odinfmt/main.odin

@@ -70,7 +70,7 @@ walk_files :: proc(info: os.File_Info, in_err: os.Errno) -> (err: os.Errno, skip
 }
 }
 
 
 main :: proc() {
 main :: proc() {
-	init_global_temporary_allocator(mem.megabytes(100));
+	init_global_temporary_allocator(mem.Megabyte * 100)
 
 
 	args: Args;
 	args: Args;