Browse Source

Declaration grouping uses () rather than {}; Fix some problem with compilation on *nix

Ginger Bill 8 years ago
parent
commit
2deb2f8eeb

+ 3 - 3
build.sh

@@ -2,8 +2,8 @@
 
 
 release_mode=0
 release_mode=0
 
 
-warnings_to_disable="-std=c11 -Wno-switch -Wno-pointer-sign -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare -Wno-macro-redefined"
-libraries="-pthread -ldl -lm"
+warnings_to_disable="-std=c++11 -g -Wno-switch -Wno-pointer-sign -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare -Wno-macro-redefined"
+libraries="-pthread -ldl -lm -lstdc++"
 other_args=""
 other_args=""
 compiler="clang"
 compiler="clang"
 
 
@@ -19,6 +19,6 @@ if [[ "$(uname)" == "Darwin" ]]; then
 	other_args="${other_args} -liconv"
 	other_args="${other_args} -liconv"
 fi
 fi
 
 
-${compiler} src/main.c ${warnings_to_disable} ${libraries} ${other_args} -o odin
+${compiler} src/main.cpp ${warnings_to_disable} ${libraries} ${other_args} -o odin
 
 
 ./odin run code/demo.odin
 ./odin run code/demo.odin

+ 3 - 1
code/demo.odin

@@ -1,4 +1,6 @@
-import "fmt.odin";
+import (
+	"fmt.odin";
+)
 
 
 proc main() {
 proc main() {
 	let program = "+ + * - /";
 	let program = "+ + * - /";

+ 20 - 23
core/_preload.odin

@@ -1,11 +1,11 @@
 #shared_global_scope;
 #shared_global_scope;
 
 
-import {
+import (
 	"os.odin";
 	"os.odin";
 	"fmt.odin";
 	"fmt.odin";
 	"utf8.odin";
 	"utf8.odin";
 	"raw.odin";
 	"raw.odin";
-}
+)
 // Naming Conventions:
 // Naming Conventions:
 // In general, PascalCase for types and snake_case for values
 // In general, PascalCase for types and snake_case for values
 //
 //
@@ -25,7 +25,7 @@ import {
 
 
 // IMPORTANT NOTE(bill): Do not change the order of any of this data
 // IMPORTANT NOTE(bill): Do not change the order of any of this data
 // The compiler relies upon this _exact_ order
 // The compiler relies upon this _exact_ order
-type {
+type (
 	TypeInfoEnumValue raw_union {
 	TypeInfoEnumValue raw_union {
 		f: f64,
 		f: f64,
 		i: i128,
 		i: i128,
@@ -107,16 +107,16 @@ type {
 			offsets: []i32,
 			offsets: []i32,
 		},
 		},
 	}
 	}
-}
+)
 
 
 // NOTE(bill): only the ones that are needed (not all types)
 // NOTE(bill): only the ones that are needed (not all types)
 // This will be set by the compiler
 // This will be set by the compiler
-var {
+var (
 	__type_table: []TypeInfo;
 	__type_table: []TypeInfo;
 
 
 	__argv__: ^^u8;
 	__argv__: ^^u8;
 	__argc__: i32;
 	__argc__: i32;
-}
+)
 
 
 proc type_info_base(info: ^TypeInfo) -> ^TypeInfo {
 proc type_info_base(info: ^TypeInfo) -> ^TypeInfo {
 	if info == nil {
 	if info == nil {
@@ -155,7 +155,7 @@ foreign __llvm_core {
 }
 }
 
 
 // IMPORTANT NOTE(bill): Must be in this order (as the compiler relies upon it)
 // IMPORTANT NOTE(bill): Must be in this order (as the compiler relies upon it)
-type {
+type (
 	AllocatorMode enum u8 {
 	AllocatorMode enum u8 {
 		Alloc,
 		Alloc,
 		Free,
 		Free,
@@ -163,8 +163,8 @@ type {
 		Resize,
 		Resize,
 	}
 	}
 	AllocatorProc proc(allocator_data: rawptr, mode: AllocatorMode,
 	AllocatorProc proc(allocator_data: rawptr, mode: AllocatorMode,
-	                        size, alignment: int,
-	                        old_memory: rawptr, old_size: int, flags: u64) -> rawptr;
+	                   size, alignment: int,
+	                   old_memory: rawptr, old_size: int, flags: u64 = 0) -> rawptr;
 	Allocator struct #ordered {
 	Allocator struct #ordered {
 		procedure: AllocatorProc,
 		procedure: AllocatorProc,
 		data:      rawptr,
 		data:      rawptr,
@@ -172,14 +172,14 @@ type {
 
 
 
 
 	Context struct #ordered {
 	Context struct #ordered {
-		thread_id: int,
+		thread_id:  int,
 
 
-		allocator: Allocator,
+		allocator:  Allocator,
 
 
 		user_data:  rawptr,
 		user_data:  rawptr,
 		user_index: int,
 		user_index: int,
 	}
 	}
-}
+)
 
 
 #thread_local var __context: Context;
 #thread_local var __context: Context;
 
 
@@ -198,9 +198,7 @@ proc __check_context() {
 	}
 	}
 }
 }
 
 
-proc alloc(size: int) -> rawptr #inline { return alloc_align(size, DEFAULT_ALIGNMENT); }
-
-proc alloc_align(size, alignment: int) -> rawptr #inline {
+proc alloc(size: int, alignment: int = DEFAULT_ALIGNMENT) -> rawptr #inline {
 	__check_context();
 	__check_context();
 	var a = context.allocator;
 	var a = context.allocator;
 	return a.procedure(a.data, AllocatorMode.Alloc, size, alignment, nil, 0, 0);
 	return a.procedure(a.data, AllocatorMode.Alloc, size, alignment, nil, 0, 0);
@@ -228,8 +226,7 @@ proc free_all() #inline {
 }
 }
 
 
 
 
-proc resize      (ptr: rawptr, old_size, new_size: int) -> rawptr #inline { return resize_align(ptr, old_size, new_size, DEFAULT_ALIGNMENT); }
-proc resize_align(ptr: rawptr, old_size, new_size, alignment: int) -> rawptr #inline {
+proc resize(ptr: rawptr, old_size, new_size: int, alignment: int = DEFAULT_ALIGNMENT) -> rawptr #inline {
 	__check_context();
 	__check_context();
 	var a = context.allocator;
 	var a = context.allocator;
 	return a.procedure(a.data, AllocatorMode.Resize, new_size, alignment, ptr, old_size, 0);
 	return a.procedure(a.data, AllocatorMode.Resize, new_size, alignment, ptr, old_size, 0);
@@ -239,7 +236,7 @@ proc resize_align(ptr: rawptr, old_size, new_size, alignment: int) -> rawptr #in
 
 
 proc default_resize_align(old_memory: rawptr, old_size, new_size, alignment: int) -> rawptr {
 proc default_resize_align(old_memory: rawptr, old_size, new_size, alignment: int) -> rawptr {
 	if old_memory == nil {
 	if old_memory == nil {
-		return alloc_align(new_size, alignment);
+		return alloc(new_size, alignment);
 	}
 	}
 
 
 	if new_size == 0 {
 	if new_size == 0 {
@@ -251,7 +248,7 @@ proc default_resize_align(old_memory: rawptr, old_size, new_size, alignment: int
 		return old_memory;
 		return old_memory;
 	}
 	}
 
 
-	var new_memory = alloc_align(new_size, alignment);
+	var new_memory = alloc(new_size, alignment);
 	if new_memory == nil {
 	if new_memory == nil {
 		return nil;
 		return nil;
 	}
 	}
@@ -263,8 +260,8 @@ proc default_resize_align(old_memory: rawptr, old_size, new_size, alignment: int
 
 
 
 
 proc default_allocator_proc(allocator_data: rawptr, mode: AllocatorMode,
 proc default_allocator_proc(allocator_data: rawptr, mode: AllocatorMode,
-                               size, alignment: int,
-                               old_memory: rawptr, old_size: int, flags: u64) -> rawptr {
+                            size, alignment: int,
+                            old_memory: rawptr, old_size: int, flags: u64) -> rawptr {
 	using AllocatorMode;
 	using AllocatorMode;
 
 
 	match mode {
 	match mode {
@@ -561,7 +558,7 @@ proc __default_hash_string(s: string) -> u128 {
 
 
 const __INITIAL_MAP_CAP = 16;
 const __INITIAL_MAP_CAP = 16;
 
 
-type {
+type (
 	__MapKey struct #ordered {
 	__MapKey struct #ordered {
 		hash: u128,
 		hash: u128,
 		str:  string,
 		str:  string,
@@ -589,7 +586,7 @@ type {
 		value_offset:  int,
 		value_offset:  int,
 		value_size:    int,
 		value_size:    int,
 	}
 	}
-}
+)
 
 
 proc __dynamic_map_reserve(using header: __MapHeader, cap: int)  {
 proc __dynamic_map_reserve(using header: __MapHeader, cap: int)  {
 	__dynamic_array_reserve(&m.hashes, size_of(int), align_of(int), cap);
 	__dynamic_array_reserve(&m.hashes, size_of(int), align_of(int), cap);

+ 2 - 2
core/bits.odin

@@ -1,4 +1,4 @@
-const {
+const (
 	U8_MIN   =   u8(0);
 	U8_MIN   =   u8(0);
 	U16_MIN  =  u16(0);
 	U16_MIN  =  u16(0);
 	U32_MIN  =  u32(0);
 	U32_MIN  =  u32(0);
@@ -22,7 +22,7 @@ const {
 	I32_MAX  =  i32(0x7fff_ffff);
 	I32_MAX  =  i32(0x7fff_ffff);
 	I64_MAX  =  i64(0x7fff_ffff_ffff_ffff);
 	I64_MAX  =  i64(0x7fff_ffff_ffff_ffff);
 	I128_MAX = i128(0x7fff_ffff_ffff_ffff_ffff_ffff_ffff_ffff);
 	I128_MAX = i128(0x7fff_ffff_ffff_ffff_ffff_ffff_ffff_ffff);
-}
+)
 
 
 proc count_ones(i:   u8) ->   u8 { foreign __llvm_core proc __llvm_ctpop(u8)   ->   u8 #link_name "llvm.ctpop.i8";  return __llvm_ctpop(i); }
 proc count_ones(i:   u8) ->   u8 { foreign __llvm_core proc __llvm_ctpop(u8)   ->   u8 #link_name "llvm.ctpop.i8";  return __llvm_ctpop(i); }
 proc count_ones(i:   i8) ->   i8 { foreign __llvm_core proc __llvm_ctpop(i8)   ->   i8 #link_name "llvm.ctpop.i8";  return __llvm_ctpop(i); }
 proc count_ones(i:   i8) ->   i8 { foreign __llvm_core proc __llvm_ctpop(i8)   ->   i8 #link_name "llvm.ctpop.i8";  return __llvm_ctpop(i); }

+ 2 - 2
core/decimal.odin

@@ -170,10 +170,10 @@ proc shift_left(a: ^Decimal, k: uint) {
 }
 }
 
 
 proc shift(a: ^Decimal, k: int) {
 proc shift(a: ^Decimal, k: int) {
-	const {
+	const (
 		uint_size = 8*size_of(uint);
 		uint_size = 8*size_of(uint);
 		max_shift = uint_size-4;
 		max_shift = uint_size-4;
-	}
+	)
 
 
 	match {
 	match {
 	case a.count == 0:
 	case a.count == 0:

+ 10 - 10
core/fmt.odin

@@ -1,11 +1,11 @@
-import {
+import (
 	"os.odin";
 	"os.odin";
 	"mem.odin";
 	"mem.odin";
 	"utf8.odin";
 	"utf8.odin";
 	"types.odin";
 	"types.odin";
 	"strconv.odin";
 	"strconv.odin";
 	"raw.odin";
 	"raw.odin";
-}
+)
 
 
 const _BUFFER_SIZE = 1<<12;
 const _BUFFER_SIZE = 1<<12;
 
 
@@ -583,10 +583,10 @@ proc _fmt_int(fi: ^FmtInfo, u: u128, base: int, is_signed: bool, bit_size: int,
 	_pad(fi, s);
 	_pad(fi, s);
 }
 }
 
 
-let {
+let (
 	__DIGITS_LOWER = "0123456789abcdefx";
 	__DIGITS_LOWER = "0123456789abcdefx";
 	__DIGITS_UPPER = "0123456789ABCDEFX";
 	__DIGITS_UPPER = "0123456789ABCDEFX";
-}
+)
 
 
 proc fmt_rune(fi: ^FmtInfo, r: rune, verb: rune) {
 proc fmt_rune(fi: ^FmtInfo, r: rune, verb: rune) {
 	match verb {
 	match verb {
@@ -734,12 +734,12 @@ proc fmt_enum(fi: ^FmtInfo, v: any, verb: rune) {
 		case 'd', 'f':
 		case 'd', 'f':
 			fmt_arg(fi, any{v.data, type_info_base(e.base)}, verb);
 			fmt_arg(fi, any{v.data, type_info_base(e.base)}, verb);
 		case 's', 'v':
 		case 's', 'v':
-			var {
+			var (
 				i:  i128;
 				i:  i128;
 				f:  f64;
 				f:  f64;
 				ok: bool;
 				ok: bool;
 				a:  any;
 				a:  any;
-			}
+			)
 			a = any{v.data, type_info_base(e.base)};
 			a = any{v.data, type_info_base(e.base)};
 			match v in a {
 			match v in a {
 			case rune:  i = i128(v);
 			case rune:  i = i128(v);
@@ -898,13 +898,13 @@ proc fmt_value(fi: ^FmtInfo, v: any, verb: rune) {
 
 
 		write_string(fi.buf, "map[");
 		write_string(fi.buf, "map[");
 		defer write_byte(fi.buf, ']');
 		defer write_byte(fi.buf, ']');
-		var {
+		var (
 			entries    = &(^raw.DynamicMap(v.data).entries);
 			entries    = &(^raw.DynamicMap(v.data).entries);
 			gs         = type_info_base(info.generated_struct).(^Struct);
 			gs         = type_info_base(info.generated_struct).(^Struct);
 			ed         = type_info_base(gs.types[1]).(^DynamicArray);
 			ed         = type_info_base(gs.types[1]).(^DynamicArray);
 			entry_type = ed.elem.(^Struct);
 			entry_type = ed.elem.(^Struct);
 			entry_size = ed.elem_size;
 			entry_size = ed.elem_size;
-		}
+		)
 		for i in 0..<entries.len {
 		for i in 0..<entries.len {
 			if i > 0 {
 			if i > 0 {
 				write_string(fi.buf, ", ");
 				write_string(fi.buf, ", ");
@@ -1081,12 +1081,12 @@ proc sbprintln(buf: ^StringBuffer, args: ..any) -> string {
 }
 }
 
 
 proc sbprintf(b: ^StringBuffer, fmt: string, args: ..any) -> string {
 proc sbprintf(b: ^StringBuffer, fmt: string, args: ..any) -> string {
-	var {
+	var (
 		end            = len(fmt);
 		end            = len(fmt);
 		arg_index: int = 0;
 		arg_index: int = 0;
 		was_prev_index = false;
 		was_prev_index = false;
 		fi: FmtInfo;
 		fi: FmtInfo;
-	}
+	)
 	for var i = 0; i < end; /**/ {
 	for var i = 0; i < end; /**/ {
 		fi = FmtInfo{buf = b, good_arg_index = true};
 		fi = FmtInfo{buf = b, good_arg_index = true};
 
 

+ 10 - 10
core/hash.odin

@@ -46,17 +46,17 @@ proc fnv64a(data: []u8) -> u64 {
 }
 }
 
 
 proc murmur32(data: []u8) -> u32 {
 proc murmur32(data: []u8) -> u32 {
-	const {
+	const (
 		c1_32: u32 = 0xcc9e2d51;
 		c1_32: u32 = 0xcc9e2d51;
 		c2_32: u32 = 0x1b873593;
 		c2_32: u32 = 0x1b873593;
-	}
+	)
 
 
-	var {
+	var (
 		h1: u32 = 0;
 		h1: u32 = 0;
 		nblocks = len(data)/4;
 		nblocks = len(data)/4;
 		p = &data[0];
 		p = &data[0];
 		p1 = p + 4*nblocks;
 		p1 = p + 4*nblocks;
-	}
+	)
 
 
 	for ; p < p1; p += 4 {
 	for ; p < p1; p += 4 {
 		var k1 = ^u32(p)^;
 		var k1 = ^u32(p)^;
@@ -102,10 +102,10 @@ proc murmur64(data: []u8) -> u64 {
 	const SEED = 0x9747b28c;
 	const SEED = 0x9747b28c;
 
 
 	when size_of(int) == 8 {
 	when size_of(int) == 8 {
-		const {
+		const (
 			m = 0xc6a4a7935bd1e995;
 			m = 0xc6a4a7935bd1e995;
 			r = 47;
 			r = 47;
-		}
+		)
 
 
 		var h: u64 = SEED ~ (u64(len(data)) * m);
 		var h: u64 = SEED ~ (u64(len(data)) * m);
 		var data64 = slice_ptr(^u64(&data[0]), len(data)/size_of(u64));
 		var data64 = slice_ptr(^u64(&data[0]), len(data)/size_of(u64));
@@ -139,18 +139,18 @@ proc murmur64(data: []u8) -> u64 {
 
 
 		return h;
 		return h;
 	} else {
 	} else {
-		const {
+		const (
 			m = 0x5bd1e995;
 			m = 0x5bd1e995;
 			r = 24;
 			r = 24;
-		}
+		)
 
 
-		var {
+		var (
 			h1 = u32(SEED) ~ u32(len(data));
 			h1 = u32(SEED) ~ u32(len(data));
 			h2 = u32(SEED) >> 32;
 			h2 = u32(SEED) >> 32;
 			data32 = slice_ptr(^u32(&data[0]), len(data)/size_of(u32));
 			data32 = slice_ptr(^u32(&data[0]), len(data)/size_of(u32));
 			len = len(data);
 			len = len(data);
 			i = 0;
 			i = 0;
-		}
+		)
 
 
 		for len >= 8 {
 		for len >= 8 {
 			var k1, k2: u32;
 			var k1, k2: u32;

+ 14 - 14
core/math.odin

@@ -1,4 +1,4 @@
-const {
+const (
 	TAU          = 6.28318530717958647692528676655900576;
 	TAU          = 6.28318530717958647692528676655900576;
 	PI           = 3.14159265358979323846264338327950288;
 	PI           = 3.14159265358979323846264338327950288;
 	ONE_OVER_TAU = 0.636619772367581343075535053490057448;
 	ONE_OVER_TAU = 0.636619772367581343075535053490057448;
@@ -16,8 +16,8 @@ const {
 
 
 	τ = TAU;
 	τ = TAU;
 	π = PI;
 	π = PI;
-}
-type {
+)
+type (
 	Vec2 [vector 2]f32;
 	Vec2 [vector 2]f32;
 	Vec3 [vector 3]f32;
 	Vec3 [vector 3]f32;
 	Vec4 [vector 4]f32;
 	Vec4 [vector 4]f32;
@@ -28,7 +28,7 @@ type {
 	Mat4 [4][4]f32;
 	Mat4 [4][4]f32;
 
 
 	Complex complex64;
 	Complex complex64;
-}
+)
 
 
 foreign __llvm_core {
 foreign __llvm_core {
 	proc sqrt(x: f32) -> f32          #link_name "llvm.sqrt.f32";
 	proc sqrt(x: f32) -> f32          #link_name "llvm.sqrt.f32";
@@ -203,7 +203,7 @@ proc mul(m: Mat4, v: Vec4) -> Vec4 {
 proc inverse(m: Mat4) -> Mat4 {
 proc inverse(m: Mat4) -> Mat4 {
 	var o: Mat4;
 	var o: Mat4;
 
 
-	var {
+	var (
 		sf00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
 		sf00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
 		sf01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
 		sf01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
 		sf02 = m[2][1] * m[3][2] - m[3][1] * m[2][2];
 		sf02 = m[2][1] * m[3][2] - m[3][1] * m[2][2];
@@ -223,7 +223,7 @@ proc inverse(m: Mat4) -> Mat4 {
 		sf16 = m[1][0] * m[2][3] - m[2][0] * m[1][3];
 		sf16 = m[1][0] * m[2][3] - m[2][0] * m[1][3];
 		sf17 = m[1][0] * m[2][2] - m[2][0] * m[1][2];
 		sf17 = m[1][0] * m[2][2] - m[2][0] * m[1][2];
 		sf18 = m[1][0] * m[2][1] - m[2][0] * m[1][1];
 		sf18 = m[1][0] * m[2][1] - m[2][0] * m[1][1];
-	}
+	)
 
 
 	o[0][0] = +(m[1][1] * sf00 - m[1][2] * sf01 + m[1][3] * sf02);
 	o[0][0] = +(m[1][1] * sf00 - m[1][2] * sf01 + m[1][3] * sf02);
 	o[0][1] = -(m[1][0] * sf00 - m[1][2] * sf03 + m[1][3] * sf04);
 	o[0][1] = -(m[1][0] * sf00 - m[1][2] * sf03 + m[1][3] * sf04);
@@ -281,7 +281,7 @@ proc mat4_translate(v: Vec3) -> Mat4 {
 }
 }
 
 
 proc mat4_rotate(v: Vec3, angle_radians: f32) -> Mat4 {
 proc mat4_rotate(v: Vec3, angle_radians: f32) -> Mat4 {
-	var {
+	var (
 		c = cos(angle_radians);
 		c = cos(angle_radians);
 		s = sin(angle_radians);
 		s = sin(angle_radians);
 
 
@@ -289,7 +289,7 @@ proc mat4_rotate(v: Vec3, angle_radians: f32) -> Mat4 {
 		t = a * (1-c);
 		t = a * (1-c);
 
 
 		rot = mat4_identity();
 		rot = mat4_identity();
-	}
+	)
 
 
 	rot[0][0] = c + t.x*a.x;
 	rot[0][0] = c + t.x*a.x;
 	rot[0][1] = 0 + t.x*a.y + s*a.z;
 	rot[0][1] = 0 + t.x*a.y + s*a.z;
@@ -325,11 +325,11 @@ proc scale(m: Mat4, s: f32) -> Mat4 {
 
 
 
 
 proc look_at(eye, centre, up: Vec3) -> Mat4 {
 proc look_at(eye, centre, up: Vec3) -> Mat4 {
-	var {
+	var (
 		f = norm(centre - eye);
 		f = norm(centre - eye);
 		s = norm(cross(f, up));
 		s = norm(cross(f, up));
 		u = cross(s, f);
 		u = cross(s, f);
-	}
+	)
 
 
 	return Mat4{
 	return Mat4{
 		{+s.x, +u.x, -f.x, 0},
 		{+s.x, +u.x, -f.x, 0},
@@ -340,10 +340,10 @@ proc look_at(eye, centre, up: Vec3) -> Mat4 {
 }
 }
 
 
 proc perspective(fovy, aspect, near, far: f32) -> Mat4 {
 proc perspective(fovy, aspect, near, far: f32) -> Mat4 {
-	var {
+	var (
 		m: Mat4;
 		m: Mat4;
 		tan_half_fovy = tan(0.5 * fovy);
 		tan_half_fovy = tan(0.5 * fovy);
-	}
+	)
 	m[0][0] = 1.0 / (aspect*tan_half_fovy);
 	m[0][0] = 1.0 / (aspect*tan_half_fovy);
 	m[1][1] = 1.0 / (tan_half_fovy);
 	m[1][1] = 1.0 / (tan_half_fovy);
 	m[2][2] = -(far + near) / (far - near);
 	m[2][2] = -(far + near) / (far - near);
@@ -367,7 +367,7 @@ proc ortho3d(left, right, bottom, top, near, far: f32) -> Mat4 {
 
 
 
 
 
 
-const {
+const (
 	F32_DIG        = 6;
 	F32_DIG        = 6;
 	F32_EPSILON    = 1.192092896e-07;
 	F32_EPSILON    = 1.192092896e-07;
 	F32_GUARD      = 0;
 	F32_GUARD      = 0;
@@ -393,4 +393,4 @@ const {
 	F64_MIN_EXP    = -1021;                    // min binary exponent
 	F64_MIN_EXP    = -1021;                    // min binary exponent
 	F64_RADIX      = 2;                        // exponent radix
 	F64_RADIX      = 2;                        // exponent radix
 	F64_ROUNDS     = 1;                        // addition rounding: near
 	F64_ROUNDS     = 1;                        // addition rounding: near
-}
+)

+ 4 - 4
core/mem.odin

@@ -1,7 +1,7 @@
-import {
+import (
 	"fmt.odin";
 	"fmt.odin";
 	"os.odin";
 	"os.odin";
-}
+)
 foreign __llvm_core {
 foreign __llvm_core {
 	proc swap(b: u16) -> u16 #link_name "llvm.bswap.i16";
 	proc swap(b: u16) -> u16 #link_name "llvm.bswap.i16";
 	proc swap(b: u32) -> u32 #link_name "llvm.bswap.i32";
 	proc swap(b: u32) -> u32 #link_name "llvm.bswap.i32";
@@ -80,7 +80,7 @@ proc allocation_header(data: rawptr) -> ^AllocationHeader {
 
 
 
 
 // Custom allocators
 // Custom allocators
-type {
+type (
 	Arena struct {
 	Arena struct {
 		backing:    Allocator,
 		backing:    Allocator,
 		offset:     int,
 		offset:     int,
@@ -92,7 +92,7 @@ type {
 		arena:          ^Arena,
 		arena:          ^Arena,
 		original_count: int,
 		original_count: int,
 	}
 	}
-}
+)
 
 
 
 
 
 

+ 6 - 6
core/opengl.odin

@@ -1,11 +1,11 @@
-foreign_system_library {
+foreign_system_library (
 	lib "opengl32.lib" when ODIN_OS == "windows";
 	lib "opengl32.lib" when ODIN_OS == "windows";
 	lib "gl" when ODIN_OS == "linux";
 	lib "gl" when ODIN_OS == "linux";
-}
-import {
+)
+import (
 	win32 "sys/windows.odin" when ODIN_OS == "windows";
 	win32 "sys/windows.odin" when ODIN_OS == "windows";
 	"sys/wgl.odin" when ODIN_OS == "windows";
 	"sys/wgl.odin" when ODIN_OS == "windows";
-}
+)
 import_load "opengl_constants.odin";
 import_load "opengl_constants.odin";
 
 
 foreign lib {
 foreign lib {
@@ -54,7 +54,7 @@ proc get_proc_address(name: string) -> proc() #cc_c {
 	return res;
 	return res;
 }
 }
 
 
-var {
+var (
 	GenBuffers:               proc(count: i32, buffers: ^u32) #cc_c;
 	GenBuffers:               proc(count: i32, buffers: ^u32) #cc_c;
 	GenVertexArrays:          proc(count: i32, buffers: ^u32) #cc_c;
 	GenVertexArrays:          proc(count: i32, buffers: ^u32) #cc_c;
 	GenSamplers:              proc(count: i32, buffers: ^u32) #cc_c;
 	GenSamplers:              proc(count: i32, buffers: ^u32) #cc_c;
@@ -114,7 +114,7 @@ var {
 	UniformMatrix4fv:         proc(loc: i32, count: u32, transpose: i32, value: ^f32) #cc_c;
 	UniformMatrix4fv:         proc(loc: i32, count: u32, transpose: i32, value: ^f32) #cc_c;
 
 
 	GetUniformLocation:       proc(program: u32, name: ^u8) -> i32 #cc_c;
 	GetUniformLocation:       proc(program: u32, name: ^u8) -> i32 #cc_c;
-}
+)
 
 
 proc init() {
 proc init() {
 	proc set_proc_address(p: rawptr, name: string) #inline {
 	proc set_proc_address(p: rawptr, name: string) #inline {

+ 2 - 2
core/opengl_constants.odin

@@ -1,4 +1,4 @@
-const {
+const (
 	FALSE                          = 0;
 	FALSE                          = 0;
 	TRUE                           = 1;
 	TRUE                           = 1;
 
 
@@ -1382,4 +1382,4 @@ const {
 	DEBUG_SEVERITY_HIGH_ARB        = 0x9146;
 	DEBUG_SEVERITY_HIGH_ARB        = 0x9146;
 	DEBUG_SEVERITY_MEDIUM_ARB      = 0x9147;
 	DEBUG_SEVERITY_MEDIUM_ARB      = 0x9147;
 	DEBUG_SEVERITY_LOW_ARB         = 0x9148;
 	DEBUG_SEVERITY_LOW_ARB         = 0x9148;
-}
+)

+ 2 - 2
core/os.odin

@@ -1,8 +1,8 @@
-import_load {
+import_load (
 	"os_windows.odin" when ODIN_OS == "windows";
 	"os_windows.odin" when ODIN_OS == "windows";
 	"os_x.odin"       when ODIN_OS == "osx";
 	"os_x.odin"       when ODIN_OS == "osx";
 	"os_linux.odin"   when ODIN_OS == "linux";
 	"os_linux.odin"   when ODIN_OS == "linux";
-}
+)
 
 
 proc write_string(fd: Handle, str: string) -> (int, Errno) {
 proc write_string(fd: Handle, str: string) -> (int, Errno) {
 	return write(fd, []u8(str));
 	return write(fd, []u8(str));

+ 17 - 17
core/os_linux.odin

@@ -1,16 +1,16 @@
-foreign_system_library {
+foreign_system_library (
 	dl   "dl";
 	dl   "dl";
 	libc "c";
 	libc "c";
-}
+)
 import "strings.odin";
 import "strings.odin";
 
 
-type {
+type (
 	Handle   i32;
 	Handle   i32;
 	FileTime u64;
 	FileTime u64;
 	Errno    i32;
 	Errno    i32;
-}
+)
 
 
-const {
+const (
 	O_RDONLY   = 0x00000;
 	O_RDONLY   = 0x00000;
 	O_WRONLY   = 0x00001;
 	O_WRONLY   = 0x00001;
 	O_RDWR     = 0x00002;
 	O_RDWR     = 0x00002;
@@ -23,24 +23,24 @@ const {
 	O_SYNC     = 0x01000;
 	O_SYNC     = 0x01000;
 	O_ASYNC    = 0x02000;
 	O_ASYNC    = 0x02000;
 	O_CLOEXEC  = 0x80000;
 	O_CLOEXEC  = 0x80000;
-}
+)
 
 
-const {
+const (
 	SEEK_SET   = 0;
 	SEEK_SET   = 0;
 	SEEK_CUR   = 1;
 	SEEK_CUR   = 1;
 	SEEK_END   = 2;
 	SEEK_END   = 2;
 	SEEK_DATA  = 3;
 	SEEK_DATA  = 3;
 	SEEK_HOLE  = 4;
 	SEEK_HOLE  = 4;
 	SEEK_MAX   = SEEK_HOLE;
 	SEEK_MAX   = SEEK_HOLE;
-}
-const {
+)
+const (
 	// NOTE(zangent): These are OS specific!
 	// NOTE(zangent): These are OS specific!
 	// Do not mix these up!
 	// Do not mix these up!
 	RTLD_LAZY         = 0x001;
 	RTLD_LAZY         = 0x001;
 	RTLD_NOW          = 0x002;
 	RTLD_NOW          = 0x002;
 	RTLD_BINDING_MASK = 0x3;
 	RTLD_BINDING_MASK = 0x3;
 	RTLD_GLOBAL       = 0x100;
 	RTLD_GLOBAL       = 0x100;
-}
+)
 
 
 // "Argv" arguments converted to Odin strings
 // "Argv" arguments converted to Odin strings
 let args = _alloc_command_line_arguments();
 let args = _alloc_command_line_arguments();
@@ -80,7 +80,7 @@ type Stat struct #ordered {
 };
 };
 
 
 // File type
 // File type
-const {
+const (
 	S_IFMT   = 0170000; // Type of file mask
 	S_IFMT   = 0170000; // Type of file mask
 	S_IFIFO  = 0010000; // Named pipe (fifo)
 	S_IFIFO  = 0010000; // Named pipe (fifo)
 	S_IFCHR  = 0020000; // Character special
 	S_IFCHR  = 0020000; // Character special
@@ -112,7 +112,7 @@ const {
 	S_ISUID = 0004000; // Set user id on execution
 	S_ISUID = 0004000; // Set user id on execution
 	S_ISGID = 0002000; // Set group id on execution
 	S_ISGID = 0002000; // Set group id on execution
 	S_ISVTX = 0001000; // Directory restrcted delete
 	S_ISVTX = 0001000; // Directory restrcted delete
-}
+)
 
 
 proc S_ISLNK (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFLNK; }
 proc S_ISLNK (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFLNK; }
 proc S_ISREG (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFREG; }
 proc S_ISREG (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFREG; }
@@ -122,12 +122,12 @@ proc S_ISBLK (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFBLK; }
 proc S_ISFIFO(m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFIFO; }
 proc S_ISFIFO(m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFIFO; }
 proc S_ISSOCK(m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFSOCK;}
 proc S_ISSOCK(m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFSOCK;}
 
 
-const {
+const (
 	R_OK = 4; // Test for read permission
 	R_OK = 4; // Test for read permission
 	W_OK = 2; // Test for write permission
 	W_OK = 2; // Test for write permission
 	X_OK = 1; // Test for execute permission
 	X_OK = 1; // Test for execute permission
 	F_OK = 0; // Test for file existance
 	F_OK = 0; // Test for file existance
-}
+)
 
 
 foreign libc {
 foreign libc {
 	proc _unix_open  (path: ^u8, mode: int) -> Handle                  #link_name "open";
 	proc _unix_open  (path: ^u8, mode: int) -> Handle                  #link_name "open";
@@ -165,7 +165,7 @@ proc open_simple(path: string, mode: int) -> (Handle, Errno) {
 	return handle, 0;
 	return handle, 0;
 }
 }
 // NOTE(zangent): This is here for compatability reasons. Should this be here?
 // NOTE(zangent): This is here for compatability reasons. Should this be here?
-proc open(path: string, mode: int, perm: u32) -> (Handle, Errno) {
+proc open(path: string, mode: int = O_RDONLY, perm: u32 = 0) -> (Handle, Errno) {
 	return open_simple(path, mode);
 	return open_simple(path, mode);
 }
 }
 
 
@@ -197,11 +197,11 @@ proc file_size(fd: Handle) -> (i64, Errno) {
 
 
 
 
 // NOTE(bill): Uses startup to initialize it
 // NOTE(bill): Uses startup to initialize it
-var {
+var (
 	stdin:  Handle = 0;
 	stdin:  Handle = 0;
 	stdout: Handle = 1;
 	stdout: Handle = 1;
 	stderr: Handle = 2;
 	stderr: Handle = 2;
-}
+)
 /* TODO(zangent): Implement these!
 /* TODO(zangent): Implement these!
 proc last_write_time(fd: Handle) -> FileTime {}
 proc last_write_time(fd: Handle) -> FileTime {}
 proc last_write_time_by_name(name: string) -> FileTime {}
 proc last_write_time_by_name(name: string) -> FileTime {}

+ 7 - 7
core/os_windows.odin

@@ -1,14 +1,14 @@
 import win32 "sys/windows.odin";
 import win32 "sys/windows.odin";
 
 
-type {
+type (
 	Handle   int;
 	Handle   int;
 	FileTime u64;
 	FileTime u64;
-}
+)
 
 
 const INVALID_HANDLE: Handle = -1;
 const INVALID_HANDLE: Handle = -1;
 
 
 
 
-const {
+const (
 	O_RDONLY   = 0x00000;
 	O_RDONLY   = 0x00000;
 	O_WRONLY   = 0x00001;
 	O_WRONLY   = 0x00001;
 	O_RDWR     = 0x00002;
 	O_RDWR     = 0x00002;
@@ -21,10 +21,10 @@ const {
 	O_SYNC     = 0x01000;
 	O_SYNC     = 0x01000;
 	O_ASYNC    = 0x02000;
 	O_ASYNC    = 0x02000;
 	O_CLOEXEC  = 0x80000;
 	O_CLOEXEC  = 0x80000;
-}
+)
 
 
 type Errno int;
 type Errno int;
-const {
+const (
 	ERROR_NONE:               Errno = 0;
 	ERROR_NONE:               Errno = 0;
 	ERROR_FILE_NOT_FOUND            = 2;
 	ERROR_FILE_NOT_FOUND            = 2;
 	ERROR_PATH_NOT_FOUND            = 3;
 	ERROR_PATH_NOT_FOUND            = 3;
@@ -51,13 +51,13 @@ const {
 
 
 	// Windows reserves errors >= 1<<29 for application use
 	// Windows reserves errors >= 1<<29 for application use
 	ERROR_FILE_IS_PIPE              = 1<<29 + 0;
 	ERROR_FILE_IS_PIPE              = 1<<29 + 0;
-}
+)
 
 
 // "Argv" arguments converted to Odin strings
 // "Argv" arguments converted to Odin strings
 let args = _alloc_command_line_arguments();
 let args = _alloc_command_line_arguments();
 
 
 
 
-proc open(path: string, mode: int, perm: u32) -> (Handle, Errno) {
+proc open(path: string, mode: int = O_RDONLY, perm: u32 = 0) -> (Handle, Errno) {
 	if len(path) == 0 {
 	if len(path) == 0 {
 		return INVALID_HANDLE, ERROR_FILE_NOT_FOUND;
 		return INVALID_HANDLE, ERROR_FILE_NOT_FOUND;
 	}
 	}

+ 17 - 17
core/os_x.odin

@@ -1,19 +1,19 @@
-foreign_system_library {
+foreign_system_library (
 	dl   "dl";
 	dl   "dl";
 	libc "c";
 	libc "c";
-}
+)
 
 
 import "strings.odin";
 import "strings.odin";
 
 
-type {
+type (
 	Handle    i32;
 	Handle    i32;
 	FileTime  u64;
 	FileTime  u64;
 	Errno     int;
 	Errno     int;
 
 
 	AddressSize int;
 	AddressSize int;
-}
+)
 
 
-const {
+const (
 	O_RDONLY   = 0x00000;
 	O_RDONLY   = 0x00000;
 	O_WRONLY   = 0x00001;
 	O_WRONLY   = 0x00001;
 	O_RDWR     = 0x00002;
 	O_RDWR     = 0x00002;
@@ -26,17 +26,17 @@ const {
 	O_SYNC     = 0x01000;
 	O_SYNC     = 0x01000;
 	O_ASYNC    = 0x02000;
 	O_ASYNC    = 0x02000;
 	O_CLOEXEC  = 0x80000;
 	O_CLOEXEC  = 0x80000;
-}
-const {
+)
+const (
 	SEEK_SET   = 0;
 	SEEK_SET   = 0;
 	SEEK_CUR   = 1;
 	SEEK_CUR   = 1;
 	SEEK_END   = 2;
 	SEEK_END   = 2;
 	SEEK_DATA  = 3;
 	SEEK_DATA  = 3;
 	SEEK_HOLE  = 4;
 	SEEK_HOLE  = 4;
 	SEEK_MAX   = SEEK_HOLE;
 	SEEK_MAX   = SEEK_HOLE;
-}
+)
 
 
-const {
+const (
 	// NOTE(zangent): These are OS specific!
 	// NOTE(zangent): These are OS specific!
 	// Do not mix these up!
 	// Do not mix these up!
 	RTLD_LAZY     = 0x1;
 	RTLD_LAZY     = 0x1;
@@ -46,7 +46,7 @@ const {
 	RTLD_NODELETE = 0x80;
 	RTLD_NODELETE = 0x80;
 	RTLD_NOLOAD   = 0x10;
 	RTLD_NOLOAD   = 0x10;
 	RTLD_FIRST    = 0x100;
 	RTLD_FIRST    = 0x100;
-}
+)
 
 
 var args: [dynamic]string;
 var args: [dynamic]string;
 
 
@@ -80,7 +80,7 @@ type Stat struct #ordered {
 };
 };
 
 
 // File type
 // File type
-const {
+const (
 	S_IFMT   = 0170000; // Type of file mask
 	S_IFMT   = 0170000; // Type of file mask
 	S_IFIFO  = 0010000; // Named pipe (fifo)
 	S_IFIFO  = 0010000; // Named pipe (fifo)
 	S_IFCHR  = 0020000; // Character special
 	S_IFCHR  = 0020000; // Character special
@@ -112,7 +112,7 @@ const {
 	S_ISUID = 0004000; // Set user id on execution
 	S_ISUID = 0004000; // Set user id on execution
 	S_ISGID = 0002000; // Set group id on execution
 	S_ISGID = 0002000; // Set group id on execution
 	S_ISVTX = 0001000; // Directory restrcted delete
 	S_ISVTX = 0001000; // Directory restrcted delete
-}
+)
 
 
 proc S_ISLNK (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFLNK; }
 proc S_ISLNK (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFLNK; }
 proc S_ISREG (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFREG; }
 proc S_ISREG (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFREG; }
@@ -122,12 +122,12 @@ proc S_ISBLK (m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFBLK; }
 proc S_ISFIFO(m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFIFO; }
 proc S_ISFIFO(m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFIFO; }
 proc S_ISSOCK(m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFSOCK;}
 proc S_ISSOCK(m: u32) -> bool #inline  {return (m & S_IFMT) == S_IFSOCK;}
 
 
-const {
+const (
 	R_OK = 4; // Test for read permission
 	R_OK = 4; // Test for read permission
 	W_OK = 2; // Test for write permission
 	W_OK = 2; // Test for write permission
 	X_OK = 1; // Test for execute permission
 	X_OK = 1; // Test for execute permission
 	F_OK = 0; // Test for file existance
 	F_OK = 0; // Test for file existance
-}
+)
 
 
 foreign libc {
 foreign libc {
 	proc unix_open  (path: ^u8, mode: int) -> Handle                               #link_name "open";
 	proc unix_open  (path: ^u8, mode: int) -> Handle                               #link_name "open";
@@ -167,7 +167,7 @@ proc open_simple(path: string, mode: int) -> (Handle, Errno) {
 }
 }
 
 
 // NOTE(zangent): This is here for compatability reasons. Should this be here?
 // NOTE(zangent): This is here for compatability reasons. Should this be here?
-proc open(path: string, mode: int, perm: u32) -> (Handle, Errno) {
+proc open(path: string, mode: int = O_RDONLY, perm: u32 = 0) -> (Handle, Errno) {
 	return open_simple(path, mode);
 	return open_simple(path, mode);
 }
 }
 
 
@@ -215,11 +215,11 @@ proc file_size(fd: Handle) -> (i64, Errno) {
 
 
 
 
 // NOTE(bill): Uses startup to initialize it
 // NOTE(bill): Uses startup to initialize it
-var {
+var (
 	stdin:  Handle = 0; // get_std_handle(win32.STD_INPUT_HANDLE);
 	stdin:  Handle = 0; // get_std_handle(win32.STD_INPUT_HANDLE);
 	stdout: Handle = 1; // get_std_handle(win32.STD_OUTPUT_HANDLE);
 	stdout: Handle = 1; // get_std_handle(win32.STD_OUTPUT_HANDLE);
 	stderr: Handle = 2; // get_std_handle(win32.STD_ERROR_HANDLE);
 	stderr: Handle = 2; // get_std_handle(win32.STD_ERROR_HANDLE);
-}
+)
 /* TODO(zangent): Implement these!
 /* TODO(zangent): Implement these!
 proc last_write_time(fd: Handle) -> FileTime {}
 proc last_write_time(fd: Handle) -> FileTime {}
 proc last_write_time_by_name(name: string) -> FileTime {}
 proc last_write_time_by_name(name: string) -> FileTime {}

+ 2 - 2
core/raw.odin

@@ -1,4 +1,4 @@
-type {
+type (
 	Any struct #ordered {
 	Any struct #ordered {
 		data:      rawptr,
 		data:      rawptr,
 		type_info: ^TypeInfo,
 		type_info: ^TypeInfo,
@@ -26,4 +26,4 @@ type {
 		hashes:  [dynamic]int,
 		hashes:  [dynamic]int,
 		entries: DynamicArray,
 		entries: DynamicArray,
 	};
 	};
-}
+)

+ 2 - 2
core/strconv.odin

@@ -223,11 +223,11 @@ type Float_Info struct {
 	bias:     int,
 	bias:     int,
 }
 }
 
 
-var {
+var (
 	_f16_info = Float_Info{10, 5,   -15};
 	_f16_info = Float_Info{10, 5,   -15};
 	_f32_info = Float_Info{23, 8,  -127};
 	_f32_info = Float_Info{23, 8,  -127};
 	_f64_info = Float_Info{52, 11, -1023};
 	_f64_info = Float_Info{52, 11, -1023};
-}
+)
 
 
 proc generic_ftoa(buf: []u8, val: f64, fmt: u8, prec, bit_size: int) -> []u8 {
 proc generic_ftoa(buf: []u8, val: f64, fmt: u8, prec, bit_size: int) -> []u8 {
 	var bits: u64;
 	var bits: u64;

+ 2 - 2
core/sync.odin

@@ -1,4 +1,4 @@
-import_load {
+import_load (
 	"sync_windows.odin" when ODIN_OS == "windows";
 	"sync_windows.odin" when ODIN_OS == "windows";
 	"sync_linux.odin"   when ODIN_OS == "linux";
 	"sync_linux.odin"   when ODIN_OS == "linux";
-}
+)

+ 2 - 2
core/sync_linux.odin

@@ -1,7 +1,7 @@
-import {
+import (
 	"atomics.odin";
 	"atomics.odin";
 	"os.odin";
 	"os.odin";
-}
+)
 
 
 type Semaphore struct {
 type Semaphore struct {
 	// _handle: win32.Handle,
 	// _handle: win32.Handle,

+ 2 - 2
core/sync_windows.odin

@@ -1,7 +1,7 @@
-import {
+import (
 	win32 "sys/windows.odin" when ODIN_OS == "windows";
 	win32 "sys/windows.odin" when ODIN_OS == "windows";
 	"atomics.odin";
 	"atomics.odin";
-}
+)
 
 
 type Semaphore struct {
 type Semaphore struct {
 	_handle: win32.Handle,
 	_handle: win32.Handle,

+ 8 - 8
core/sys/wgl.odin

@@ -1,7 +1,7 @@
 foreign_system_library "opengl32.lib" when ODIN_OS == "windows";
 foreign_system_library "opengl32.lib" when ODIN_OS == "windows";
 import . "windows.odin";
 import . "windows.odin";
 
 
-const {
+const (
 	CONTEXT_MAJOR_VERSION_ARB          = 0x2091;
 	CONTEXT_MAJOR_VERSION_ARB          = 0x2091;
 	CONTEXT_MINOR_VERSION_ARB          = 0x2092;
 	CONTEXT_MINOR_VERSION_ARB          = 0x2092;
 	CONTEXT_FLAGS_ARB                  = 0x2094;
 	CONTEXT_FLAGS_ARB                  = 0x2094;
@@ -9,9 +9,9 @@ const {
 	CONTEXT_FORWARD_COMPATIBLE_BIT_ARB = 0x0002;
 	CONTEXT_FORWARD_COMPATIBLE_BIT_ARB = 0x0002;
 	CONTEXT_CORE_PROFILE_BIT_ARB       = 0x00000001;
 	CONTEXT_CORE_PROFILE_BIT_ARB       = 0x00000001;
 	CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB = 0x00000002;
 	CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB = 0x00000002;
-}
+)
 
 
-type {
+type (
 	Hglrc    Handle;
 	Hglrc    Handle;
 	ColorRef u32;
 	ColorRef u32;
 
 
@@ -53,21 +53,21 @@ type {
 		cell_inc_x:   f32,
 		cell_inc_x:   f32,
 		cell_inc_y:   f32,
 		cell_inc_y:   f32,
 	}
 	}
-}
+)
 
 
-type {
+type (
 	CreateContextAttribsARBType proc(hdc: Hdc, h_share_context: rawptr, attribList: ^i32) -> Hglrc;
 	CreateContextAttribsARBType proc(hdc: Hdc, h_share_context: rawptr, attribList: ^i32) -> Hglrc;
 	ChoosePixelFormatARBType    proc(hdc: Hdc, attrib_i_list: ^i32, attrib_f_list: ^f32, max_formats: u32, formats: ^i32, num_formats : ^u32) -> Bool #cc_c;
 	ChoosePixelFormatARBType    proc(hdc: Hdc, attrib_i_list: ^i32, attrib_f_list: ^f32, max_formats: u32, formats: ^i32, num_formats : ^u32) -> Bool #cc_c;
 	SwapIntervalEXTType         proc(interval: i32) -> bool #cc_c;
 	SwapIntervalEXTType         proc(interval: i32) -> bool #cc_c;
 	GetExtensionsStringARBType  proc(Hdc) -> ^u8 #cc_c;
 	GetExtensionsStringARBType  proc(Hdc) -> ^u8 #cc_c;
-}
+)
 
 
-var {
+var (
 	create_context_attribs_arb: CreateContextAttribsARBType;
 	create_context_attribs_arb: CreateContextAttribsARBType;
 	choose_pixel_format_arb:    ChoosePixelFormatARBType;
 	choose_pixel_format_arb:    ChoosePixelFormatARBType;
 	swap_interval_ext:          SwapIntervalEXTType;
 	swap_interval_ext:          SwapIntervalEXTType;
 	get_extensions_string_arb:  GetExtensionsStringARBType;
 	get_extensions_string_arb:  GetExtensionsStringARBType;
-}
+)
 
 
 
 
 foreign opengl32 {
 foreign opengl32 {

+ 21 - 21
core/sys/windows.odin

@@ -1,12 +1,12 @@
-foreign_system_library {
+foreign_system_library (
 	"kernel32.lib" when ODIN_OS == "windows";
 	"kernel32.lib" when ODIN_OS == "windows";
 	"user32.lib"   when ODIN_OS == "windows";
 	"user32.lib"   when ODIN_OS == "windows";
 	"gdi32.lib"    when ODIN_OS == "windows";
 	"gdi32.lib"    when ODIN_OS == "windows";
 	"winmm.lib"    when ODIN_OS == "windows";
 	"winmm.lib"    when ODIN_OS == "windows";
 	"shell32.lib"  when ODIN_OS == "windows";
 	"shell32.lib"  when ODIN_OS == "windows";
-}
+)
 
 
-type {
+type (
 	Handle    rawptr;
 	Handle    rawptr;
 	Hwnd      Handle;
 	Hwnd      Handle;
 	Hdc       Handle;
 	Hdc       Handle;
@@ -22,13 +22,13 @@ type {
 	Lparam    int;
 	Lparam    int;
 	Lresult   int;
 	Lresult   int;
 	WndProc   proc(Hwnd, u32, Wparam, Lparam) -> Lresult #cc_c;
 	WndProc   proc(Hwnd, u32, Wparam, Lparam) -> Lresult #cc_c;
-}
+)
 
 
 type Bool i32;
 type Bool i32;
-const {
+const (
 	FALSE: Bool = 0;
 	FALSE: Bool = 0;
 	TRUE        = 1;
 	TRUE        = 1;
-}
+)
 
 
 type Point struct #ordered {
 type Point struct #ordered {
 	x, y: i32,
 	x, y: i32,
@@ -151,19 +151,19 @@ type PixelFormatDescriptor struct #ordered {
 
 
 type Proc proc() #cc_c;
 type Proc proc() #cc_c;
 
 
-const {
-	MAPVK_VK_TO_CHAR   = 2;
+const (
 	MAPVK_VK_TO_VSC    = 0;
 	MAPVK_VK_TO_VSC    = 0;
 	MAPVK_VSC_TO_VK    = 1;
 	MAPVK_VSC_TO_VK    = 1;
+	MAPVK_VK_TO_CHAR   = 2;
 	MAPVK_VSC_TO_VK_EX = 3;
 	MAPVK_VSC_TO_VK_EX = 3;
-}
+)
 
 
 
 
 
 
 const INVALID_HANDLE = Handle(~int(0));
 const INVALID_HANDLE = Handle(~int(0));
 
 
 
 
-const {
+const (
 	CS_VREDRAW    = 0x0001;
 	CS_VREDRAW    = 0x0001;
 	CS_HREDRAW    = 0x0002;
 	CS_HREDRAW    = 0x0002;
 	CS_OWNDC      = 0x0020;
 	CS_OWNDC      = 0x0020;
@@ -221,7 +221,7 @@ const {
 	SM_CYSCREEN = 1;
 	SM_CYSCREEN = 1;
 
 
 	SW_SHOW = 5;
 	SW_SHOW = 5;
-}
+)
 
 
 const COLOR_BACKGROUND = Hbrush(int(1));
 const COLOR_BACKGROUND = Hbrush(int(1));
 
 
@@ -235,24 +235,24 @@ const BI_RGB         = 0;
 const DIB_RGB_COLORS = 0x00;
 const DIB_RGB_COLORS = 0x00;
 const SRCCOPY: u32   = 0x00cc0020;
 const SRCCOPY: u32   = 0x00cc0020;
 
 
-const {
+const (
 	MONITOR_DEFAULTTONULL    = 0x00000000;
 	MONITOR_DEFAULTTONULL    = 0x00000000;
 	MONITOR_DEFAULTTOPRIMARY = 0x00000001;
 	MONITOR_DEFAULTTOPRIMARY = 0x00000001;
 	MONITOR_DEFAULTTONEAREST = 0x00000002;
 	MONITOR_DEFAULTTONEAREST = 0x00000002;
-}
-const {
+)
+const (
 	SWP_FRAMECHANGED  = 0x0020;
 	SWP_FRAMECHANGED  = 0x0020;
 	SWP_NOOWNERZORDER = 0x0200;
 	SWP_NOOWNERZORDER = 0x0200;
 	SWP_NOZORDER      = 0x0004;
 	SWP_NOZORDER      = 0x0004;
 	SWP_NOSIZE        = 0x0001;
 	SWP_NOSIZE        = 0x0001;
 	SWP_NOMOVE        = 0x0002;
 	SWP_NOMOVE        = 0x0002;
-}
+)
 
 
 
 
 
 
 
 
 // Windows OpenGL
 // Windows OpenGL
-const {
+const (
 	PFD_TYPE_RGBA             = 0;
 	PFD_TYPE_RGBA             = 0;
 	PFD_TYPE_COLORINDEX       = 1;
 	PFD_TYPE_COLORINDEX       = 1;
 	PFD_MAIN_PLANE            = 0;
 	PFD_MAIN_PLANE            = 0;
@@ -274,15 +274,15 @@ const {
 	PFD_DEPTH_DONTCARE        = 0x20000000;
 	PFD_DEPTH_DONTCARE        = 0x20000000;
 	PFD_DOUBLEBUFFER_DONTCARE = 0x40000000;
 	PFD_DOUBLEBUFFER_DONTCARE = 0x40000000;
 	PFD_STEREO_DONTCARE       = 0x80000000;
 	PFD_STEREO_DONTCARE       = 0x80000000;
-}
+)
 
 
 
 
 
 
 type GET_FILEEX_INFO_LEVELS i32;
 type GET_FILEEX_INFO_LEVELS i32;
-const {
+const (
 	GetFileExInfoStandard: GET_FILEEX_INFO_LEVELS = 0;
 	GetFileExInfoStandard: GET_FILEEX_INFO_LEVELS = 0;
 	GetFileExMaxInfoLevel                         = 1;
 	GetFileExMaxInfoLevel                         = 1;
-}
+)
 
 
 foreign kernel32 {
 foreign kernel32 {
 	proc get_last_error     () -> i32                                                                                       #link_name "GetLastError";
 	proc get_last_error     () -> i32                                                                                       #link_name "GetLastError";
@@ -463,7 +463,7 @@ proc is_key_down(key: KeyCode) -> bool #inline { return get_async_key_state(i32(
 
 
 
 
 
 
-const {
+const (
 	MAX_PATH = 0x00000104;
 	MAX_PATH = 0x00000104;
 
 
 	HANDLE_FLAG_INHERIT = 1;
 	HANDLE_FLAG_INHERIT = 1;
@@ -513,7 +513,7 @@ const {
 	FILE_TYPE_DISK = 0x0001;
 	FILE_TYPE_DISK = 0x0001;
 	FILE_TYPE_CHAR = 0x0002;
 	FILE_TYPE_CHAR = 0x0002;
 	FILE_TYPE_PIPE = 0x0003;
 	FILE_TYPE_PIPE = 0x0003;
-}
+)
 
 
 
 
 type MonitorInfo struct #ordered {
 type MonitorInfo struct #ordered {

+ 2 - 2
core/utf16.odin

@@ -1,4 +1,4 @@
-const {
+const (
 	REPLACEMENT_CHAR = '\uFFFD';
 	REPLACEMENT_CHAR = '\uFFFD';
 	MAX_RUNE         = '\U0010FFFF';
 	MAX_RUNE         = '\U0010FFFF';
 
 
@@ -6,7 +6,7 @@ const {
 	_surr2           = 0xdc00;
 	_surr2           = 0xdc00;
 	_surr3           = 0xe000;
 	_surr3           = 0xe000;
 	_surr_self       = 0x10000;
 	_surr_self       = 0x10000;
-}
+)
 
 
 proc is_surrogate(r: rune) -> bool {
 proc is_surrogate(r: rune) -> bool {
 	return _surr1 <= r && r < _surr3;
 	return _surr1 <= r && r < _surr3;

+ 4 - 4
core/utf8.odin

@@ -1,4 +1,4 @@
-const {
+const (
 	RUNE_ERROR = '\ufffd';
 	RUNE_ERROR = '\ufffd';
 	RUNE_SELF  = 0x80;
 	RUNE_SELF  = 0x80;
 	RUNE_BOM   = 0xfeff;
 	RUNE_BOM   = 0xfeff;
@@ -28,11 +28,11 @@ const {
 	// The default lowest and highest continuation byte.
 	// The default lowest and highest continuation byte.
 	LOCB = 0b1000_0000;
 	LOCB = 0b1000_0000;
 	HICB = 0b1011_1111;
 	HICB = 0b1011_1111;
-}
+)
 
 
 type AcceptRange struct { lo, hi: u8 }
 type AcceptRange struct { lo, hi: u8 }
 
 
-let {
+let (
 	accept_ranges = [5]AcceptRange{
 	accept_ranges = [5]AcceptRange{
 		{0x80, 0xbf},
 		{0x80, 0xbf},
 		{0xa0, 0xbf},
 		{0xa0, 0xbf},
@@ -60,7 +60,7 @@ let {
 		0x13, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x23, 0x03, 0x03, // 0xe0-0xef
 		0x13, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x23, 0x03, 0x03, // 0xe0-0xef
 		0x34, 0x04, 0x04, 0x04, 0x44, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, // 0xf0-0xff
 		0x34, 0x04, 0x04, 0x04, 0x44, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, // 0xf0-0xff
 	};
 	};
-}
+)
 
 
 proc encode_rune(r: rune) -> ([4]u8, int) {
 proc encode_rune(r: rune) -> ([4]u8, int) {
 	var buf: [4]u8;
 	var buf: [4]u8;

+ 1 - 1
src/build_settings.cpp

@@ -88,7 +88,7 @@ String odin_root_dir(void) {
 
 
 String odin_root_dir(void) {
 String odin_root_dir(void) {
 	String path = global_module_path;
 	String path = global_module_path;
-	Array(char) path_buf;
+	Array<char> path_buf;
 	isize len, i;
 	isize len, i;
 	gbTempArenaMemory tmp;
 	gbTempArenaMemory tmp;
 	wchar_t *text;
 	wchar_t *text;

+ 1 - 1
src/check_expr.cpp

@@ -5162,7 +5162,7 @@ Type *check_call_arguments(Checker *c, Operand *operand, Type *proc_type, AstNod
 				Entity *proc = procs[valids[i].index];
 				Entity *proc = procs[valids[i].index];
 				TokenPos pos = proc->token.pos;
 				TokenPos pos = proc->token.pos;
 				gbString pt = type_to_string(proc->type);
 				gbString pt = type_to_string(proc->type);
-				gb_printf_err("\t%.*s :: %s at %.*s(%td:%td) with score %lld\n", LIT(name), pt, LIT(pos.file), pos.line, pos.column, valids[i].score);
+				gb_printf_err("\t%.*s of type %s at %.*s(%td:%td) with score %lld\n", LIT(name), pt, LIT(pos.file), pos.line, pos.column, cast(long long)valids[i].score);
 				gb_string_free(pt);
 				gb_string_free(pt);
 			}
 			}
 			proc_type = t_invalid;
 			proc_type = t_invalid;

+ 1 - 1
src/check_stmt.cpp

@@ -1593,7 +1593,7 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
 							found = current_scope_lookup_entity(c->context.scope, str);
 							found = current_scope_lookup_entity(c->context.scope, str);
 						}
 						}
 						if (found == NULL) {
 						if (found == NULL) {
-							entity = make_entity_variable(c->allocator, c->context.scope, token, NULL, (gd->flags&VarDeclFlag_immutable) != 0);
+							entity = make_entity_variable(c->allocator, c->context.scope, token, NULL, gd->token.kind == Token_let);
 							entity->identifier = name;
 							entity->identifier = name;
 
 
 							AstNode *fl = c->context.curr_foreign_library;
 							AstNode *fl = c->context.curr_foreign_library;

+ 2 - 2
src/checker.cpp

@@ -1585,7 +1585,7 @@ void check_collect_entities(Checker *c, Array<AstNode *> nodes, bool is_file_sco
 							error_node(name, "A declaration's name must be an identifier, got %.*s", LIT(ast_node_strings[name->kind]));
 							error_node(name, "A declaration's name must be an identifier, got %.*s", LIT(ast_node_strings[name->kind]));
 							continue;
 							continue;
 						}
 						}
-						Entity *e = make_entity_variable(c->allocator, c->context.scope, name->Ident, NULL, (gd->flags&VarDeclFlag_immutable) != 0);
+						Entity *e = make_entity_variable(c->allocator, c->context.scope, name->Ident, NULL, gd->token.kind == Token_let);
 						e->Variable.is_thread_local = (gd->flags & VarDeclFlag_thread_local) != 0;
 						e->Variable.is_thread_local = (gd->flags & VarDeclFlag_thread_local) != 0;
 						e->identifier = name;
 						e->identifier = name;
 
 
@@ -2005,7 +2005,7 @@ void check_import_entities(Checker *c, Map<Scope *> *file_scopes) {
 				continue;
 				continue;
 			}
 			}
 			if (operand.value.kind == ExactValue_Bool &&
 			if (operand.value.kind == ExactValue_Bool &&
-			    !operand.value.value_bool) {
+			    operand.value.value_bool == false) {
 				continue;
 				continue;
 			}
 			}
 		}
 		}

+ 8 - 8
src/ir.cpp

@@ -2144,9 +2144,9 @@ irValue *ir_emit_arith(irProcedure *proc, TokenKind op, irValue *left, irValue *
 		bool is_unsigned = is_type_unsigned(type);
 		bool is_unsigned = is_type_unsigned(type);
 		char *name = NULL;
 		char *name = NULL;
 		if (op == Token_Quo) {
 		if (op == Token_Quo) {
-			name = is_unsigned ? "__udivti3" : "__divti3";
+			name = cast(char *)(is_unsigned ? "__udivti3" : "__divti3");
 		} else if (op == Token_Mod) {
 		} else if (op == Token_Mod) {
-			name = is_unsigned ? "__umodti3" : "__modti3";
+			name = cast(char *)(is_unsigned ? "__umodti3" : "__modti3");
 		}
 		}
 		if (name != NULL) {
 		if (name != NULL) {
 			irValue **args = gb_alloc_array(proc->module->allocator, irValue *, 2);
 			irValue **args = gb_alloc_array(proc->module->allocator, irValue *, 2);
@@ -3698,7 +3698,7 @@ irValue *ir_build_builtin_proc(irProcedure *proc, AstNode *expr, TypeAndValue tv
 
 
 	case BuiltinProc_new: {
 	case BuiltinProc_new: {
 		ir_emit_comment(proc, str_lit("new"));
 		ir_emit_comment(proc, str_lit("new"));
-		// new :: proc(Type) -> ^Type
+		// proc new(Type) -> ^Type
 		gbAllocator a = proc->module->allocator;
 		gbAllocator a = proc->module->allocator;
 
 
 		Type *type = type_of_expr(proc->module->info, ce->args[0]);
 		Type *type = type_of_expr(proc->module->info, ce->args[0]);
@@ -3720,7 +3720,7 @@ irValue *ir_build_builtin_proc(irProcedure *proc, AstNode *expr, TypeAndValue tv
 		irValue **args = gb_alloc_array(a, irValue *, 2);
 		irValue **args = gb_alloc_array(a, irValue *, 2);
 		args[0] = ir_const_int(a, size);
 		args[0] = ir_const_int(a, size);
 		args[1] = ir_const_int(a, align);
 		args[1] = ir_const_int(a, align);
-		irValue *call = ir_emit_global_call(proc, "alloc_align", args, 2);
+		irValue *call = ir_emit_global_call(proc, "alloc", args, 2);
 		irValue *v = ir_emit_conv(proc, call, ptr_type);
 		irValue *v = ir_emit_conv(proc, call, ptr_type);
 		if (type != allocation_type) {
 		if (type != allocation_type) {
 			Type *u = base_type(allocation_type);
 			Type *u = base_type(allocation_type);
@@ -3758,7 +3758,7 @@ irValue *ir_build_builtin_proc(irProcedure *proc, AstNode *expr, TypeAndValue tv
 			irValue **args = gb_alloc_array(a, irValue *, 2);
 			irValue **args = gb_alloc_array(a, irValue *, 2);
 			args[0] = slice_size;
 			args[0] = slice_size;
 			args[1] = elem_align;
 			args[1] = elem_align;
-			irValue *call = ir_emit_global_call(proc, "alloc_align", args, 2);
+			irValue *call = ir_emit_global_call(proc, "alloc", args, 2);
 
 
 			irValue *ptr = ir_emit_conv(proc, call, elem_ptr_type);
 			irValue *ptr = ir_emit_conv(proc, call, elem_ptr_type);
 			irValue *slice = ir_add_local_generated(proc, type);
 			irValue *slice = ir_add_local_generated(proc, type);
@@ -4128,7 +4128,7 @@ irValue *ir_build_builtin_proc(irProcedure *proc, AstNode *expr, TypeAndValue tv
 
 
 	case BuiltinProc_copy: {
 	case BuiltinProc_copy: {
 		ir_emit_comment(proc, str_lit("copy"));
 		ir_emit_comment(proc, str_lit("copy"));
-		// copy :: proc(dst, src: []Type) -> int
+		// proc copy(dst, src: []Type) -> int
 		AstNode *dst_node = ce->args[0];
 		AstNode *dst_node = ce->args[0];
 		AstNode *src_node = ce->args[1];
 		AstNode *src_node = ce->args[1];
 		irValue *dst_slice = ir_build_expr(proc, dst_node);
 		irValue *dst_slice = ir_build_expr(proc, dst_node);
@@ -7321,7 +7321,7 @@ void ir_gen_tree(irGen *s) {
 
 
 #if defined(GB_SYSTEM_WINDOWS)
 #if defined(GB_SYSTEM_WINDOWS)
 	if (build_context.is_dll && !has_dll_main) {
 	if (build_context.is_dll && !has_dll_main) {
-		// DllMain :: proc(inst: rawptr, reason: u32, reserved: rawptr) -> i32
+		// proc DllMain(inst: rawptr, reason: u32, reserved: rawptr) -> i32
 		String name = str_lit("DllMain");
 		String name = str_lit("DllMain");
 		Type *proc_params = make_type_tuple(a);
 		Type *proc_params = make_type_tuple(a);
 		Type *proc_results = make_type_tuple(a);
 		Type *proc_results = make_type_tuple(a);
@@ -7389,7 +7389,7 @@ void ir_gen_tree(irGen *s) {
 #endif
 #endif
 #if 0 && defined(GB_SYSTEM_WINDOWS)
 #if 0 && defined(GB_SYSTEM_WINDOWS)
 	if (!m->build_context->is_dll && !has_win_main) {
 	if (!m->build_context->is_dll && !has_win_main) {
-		// WinMain :: proc(inst, prev: rawptr, cmd_line: ^byte, cmd_show: i32) -> i32
+		// proc WinMain(inst, prev: rawptr, cmd_line: ^byte, cmd_show: i32) -> i32
 		String name = str_lit("WinMain");
 		String name = str_lit("WinMain");
 		Type *proc_params = make_type_tuple(a);
 		Type *proc_params = make_type_tuple(a);
 		Type *proc_results = make_type_tuple(a);
 		Type *proc_results = make_type_tuple(a);

+ 17 - 15
src/parser.cpp

@@ -89,8 +89,7 @@ enum ProcCallingConvention {
 
 
 enum VarDeclFlag {
 enum VarDeclFlag {
 	VarDeclFlag_using            = 1<<0,
 	VarDeclFlag_using            = 1<<0,
-	VarDeclFlag_immutable        = 1<<1,
-	VarDeclFlag_thread_local     = 1<<2,
+	VarDeclFlag_thread_local     = 1<<1,
 };
 };
 
 
 enum StmtStateFlag {
 enum StmtStateFlag {
@@ -2590,17 +2589,24 @@ AstNode *parse_gen_decl(AstFile *f, Token token, ParseSpecFunc *func) {
 	Token open = {};
 	Token open = {};
 	Token close = {};
 	Token close = {};
 
 
-	if (f->curr_token.kind == Token_OpenBrace) {
+	if (f->curr_token.kind == Token_OpenParen) {
 		specs = make_ast_node_array(f);
 		specs = make_ast_node_array(f);
-		open = expect_token(f, Token_OpenBrace);
-		while (f->curr_token.kind != Token_CloseBrace &&
+		open = expect_token(f, Token_OpenParen);
+		bool require_semicolon_after_paren = false;
+		while (f->curr_token.kind != Token_CloseParen &&
 		       f->curr_token.kind != Token_EOF) {
 		       f->curr_token.kind != Token_EOF) {
 			AstNode *spec = func(f, token);
 			AstNode *spec = func(f, token);
 			array_add(&specs, spec);
 			array_add(&specs, spec);
-			expect_semicolon(f, spec);
+			if (f->curr_token.kind == Token_CloseParen &&
+			    f->curr_token.pos.line == f->prev_token.pos.line) {
+				require_semicolon_after_paren = true;
+			} else {
+				expect_semicolon(f, spec);
+			}
 		}
 		}
-		close = expect_token(f, Token_CloseBrace);
-		if (f->curr_token.pos.line == close.pos.line ||
+		close = expect_token(f, Token_CloseParen);
+		if (require_semicolon_after_paren ||
+		    f->curr_token.pos.line == close.pos.line ||
 		    open.pos.line == close.pos.line) {
 		    open.pos.line == close.pos.line) {
 			expect_semicolon(f, NULL);
 			expect_semicolon(f, NULL);
 		}
 		}
@@ -2614,11 +2620,7 @@ AstNode *parse_gen_decl(AstFile *f, Token token, ParseSpecFunc *func) {
 		syntax_error(token, "Empty %.*s declaration list", LIT(token_strings[token.kind]));
 		syntax_error(token, "Empty %.*s declaration list", LIT(token_strings[token.kind]));
 	}
 	}
 
 
-	AstNode *decl = ast_gen_decl(f, token, open, close, specs);
-	if (token.kind == Token_let) {
-		decl->GenDecl.flags |= VarDeclFlag_immutable;
-	}
-	return decl;
+	return ast_gen_decl(f, token, open, close, specs);
 }
 }
 
 
 PARSE_SPEC_FUNC(parse_value_spec) {
 PARSE_SPEC_FUNC(parse_value_spec) {
@@ -3247,7 +3249,7 @@ AstNode *parse_field_list(AstFile *f, isize *name_count_, u32 allowed_flags, Tok
 		}
 		}
 		if (allow_token(f, Token_Eq)) {
 		if (allow_token(f, Token_Eq)) {
 			// TODO(bill): Should this be true==lhs or false==rhs?
 			// TODO(bill): Should this be true==lhs or false==rhs?
-			default_value = parse_expr(f, true);
+			default_value = parse_expr(f, false);
 			if (!is_procedure) {
 			if (!is_procedure) {
 				syntax_error(f->curr_token, "Default parameters are only allowed for procedures");
 				syntax_error(f->curr_token, "Default parameters are only allowed for procedures");
 			}
 			}
@@ -3281,7 +3283,7 @@ AstNode *parse_field_list(AstFile *f, isize *name_count_, u32 allowed_flags, Tok
 			}
 			}
 			if (allow_token(f, Token_Eq)) {
 			if (allow_token(f, Token_Eq)) {
 				// TODO(bill): Should this be true==lhs or false==rhs?
 				// TODO(bill): Should this be true==lhs or false==rhs?
-				default_value = parse_expr(f, true);
+				default_value = parse_expr(f, false);
 				if (!is_procedure) {
 				if (!is_procedure) {
 					syntax_error(f->curr_token, "Default parameters are only allowed for procedures");
 					syntax_error(f->curr_token, "Default parameters are only allowed for procedures");
 				}
 				}

+ 0 - 3
src/ssa.cpp

@@ -7,9 +7,6 @@ struct ssaProc;
 struct ssaEdge;
 struct ssaEdge;
 struct ssaRegister;
 struct ssaRegister;
 struct ssaTargetList;
 struct ssaTargetList;
-enum   ssaBlockKind;
-enum   ssaBranchPrediction;
-enum   ssaDeferExitKind;
 
 
 
 
 String ssa_mangle_name(ssaModule *m, String path, Entity *e);
 String ssa_mangle_name(ssaModule *m, String path, Entity *e);

+ 1 - 1
src/types.cpp

@@ -2445,7 +2445,7 @@ gbString write_type_to_string(gbString str, Type *type) {
 		break;
 		break;
 
 
 	case Type_BitFieldValue:
 	case Type_BitFieldValue:
-		str = gb_string_appendc(str, gb_bprintf("(bit field value with %lld bits)", cast(int)type->BitFieldValue.bits));
+		str = gb_string_appendc(str, gb_bprintf("(bit field value with %d bits)", cast(int)type->BitFieldValue.bits));
 		break;
 		break;
 	}
 	}