Browse Source

Fix loads of indentation issues with mixing spaces and tabs

gingerBill 1 year ago
parent
commit
e296d6fb90

+ 2 - 2
base/runtime/random_generator.odin

@@ -83,7 +83,7 @@ default_random_generator_proc :: proc(data: rawptr, mode: Random_Generator_Mode,
 	switch mode {
 	switch mode {
 	case .Read:
 	case .Read:
 		if r.state == 0 && r.inc == 0 {
 		if r.state == 0 && r.inc == 0 {
-		   	init(r, 0)
+			init(r, 0)
 		}
 		}
 
 
 		switch len(p) {
 		switch len(p) {
@@ -108,7 +108,7 @@ default_random_generator_proc :: proc(data: rawptr, mode: Random_Generator_Mode,
 	case .Reset:
 	case .Reset:
 		seed: u64
 		seed: u64
 		mem_copy_non_overlapping(&seed, raw_data(p), min(size_of(seed), len(p)))
 		mem_copy_non_overlapping(&seed, raw_data(p), min(size_of(seed), len(p)))
-	   	init(r, seed)
+		init(r, seed)
 
 
 	case .Query_Info:
 	case .Query_Info:
 		if len(p) != size_of(Random_Generator_Query_Info) {
 		if len(p) != size_of(Random_Generator_Query_Info) {

+ 3 - 3
core/compress/common.odin

@@ -34,13 +34,13 @@ COMPRESS_OUTPUT_ALLOCATE_MIN :: int(#config(COMPRESS_OUTPUT_ALLOCATE_MIN, 1 << 2
 */
 */
 when size_of(uintptr) == 8 {
 when size_of(uintptr) == 8 {
 
 
-        // For 64-bit platforms, we set the default max buffer size to 4 GiB,
-        // which is GZIP and PKZIP's max payload size.
+	// For 64-bit platforms, we set the default max buffer size to 4 GiB,
+	// which is GZIP and PKZIP's max payload size.
 	COMPRESS_OUTPUT_ALLOCATE_MAX :: int(#config(COMPRESS_OUTPUT_ALLOCATE_MAX, 1 << 32))
 	COMPRESS_OUTPUT_ALLOCATE_MAX :: int(#config(COMPRESS_OUTPUT_ALLOCATE_MAX, 1 << 32))
 } else {
 } else {
 	
 	
 	// For 32-bit platforms, we set the default max buffer size to 512 MiB.
 	// For 32-bit platforms, we set the default max buffer size to 512 MiB.
-        COMPRESS_OUTPUT_ALLOCATE_MAX :: int(#config(COMPRESS_OUTPUT_ALLOCATE_MAX, 1 << 29))
+	COMPRESS_OUTPUT_ALLOCATE_MAX :: int(#config(COMPRESS_OUTPUT_ALLOCATE_MAX, 1 << 29))
 }
 }
 
 
 
 

+ 4 - 4
core/container/small_array/small_array.odin

@@ -119,20 +119,20 @@ consume :: proc "odin" (a: ^$A/Small_Array($N, $T), count: int, loc := #caller_l
 }
 }
 
 
 ordered_remove :: proc "contextless" (a: ^$A/Small_Array($N, $T), index: int, loc := #caller_location) #no_bounds_check {
 ordered_remove :: proc "contextless" (a: ^$A/Small_Array($N, $T), index: int, loc := #caller_location) #no_bounds_check {
-    runtime.bounds_check_error_loc(loc, index, a.len)
-    if index+1 < a.len {
+	runtime.bounds_check_error_loc(loc, index, a.len)
+	if index+1 < a.len {
 		copy(a.data[index:], a.data[index+1:])
 		copy(a.data[index:], a.data[index+1:])
 	}
 	}
 	a.len -= 1
 	a.len -= 1
 }
 }
 
 
 unordered_remove :: proc "contextless" (a: ^$A/Small_Array($N, $T), index: int, loc := #caller_location) #no_bounds_check {
 unordered_remove :: proc "contextless" (a: ^$A/Small_Array($N, $T), index: int, loc := #caller_location) #no_bounds_check {
-    runtime.bounds_check_error_loc(loc, index, a.len)
+	runtime.bounds_check_error_loc(loc, index, a.len)
 	n := a.len-1
 	n := a.len-1
 	if index != n {
 	if index != n {
 		a.data[index] = a.data[n]
 		a.data[index] = a.data[n]
 	}
 	}
-    a.len -= 1
+	a.len -= 1
 }
 }
 
 
 clear :: proc "contextless" (a: ^$A/Small_Array($N, $T)) {
 clear :: proc "contextless" (a: ^$A/Small_Array($N, $T)) {

+ 1 - 1
core/container/topological_sort/topological_sort.odin

@@ -61,7 +61,7 @@ add_dependency :: proc(sorter: ^$S/Sorter($K), key, dependency: K) -> bool {
 	}
 	}
 	find.dependents[key] = true
 	find.dependents[key] = true
 
 
- 	find = &sorter.relations[key]
+	find = &sorter.relations[key]
 	if find == nil {
 	if find == nil {
 		find = map_insert(&sorter.relations, key, make_relations(sorter))
 		find = map_insert(&sorter.relations, key, make_relations(sorter))
 	}
 	}

+ 2 - 2
core/crypto/rand_darwin.odin

@@ -11,7 +11,7 @@ HAS_RAND_BYTES :: true
 _rand_bytes :: proc(dst: []byte) {
 _rand_bytes :: proc(dst: []byte) {
 	err := Sec.RandomCopyBytes(count=len(dst), bytes=raw_data(dst))
 	err := Sec.RandomCopyBytes(count=len(dst), bytes=raw_data(dst))
 	if err != .Success {
 	if err != .Success {
-	        msg := CF.StringCopyToOdinString(Sec.CopyErrorMessageString(err))
-	        fmt.panicf("crypto/rand_bytes: SecRandomCopyBytes returned non-zero result: %v %s", err, msg)
+		msg := CF.StringCopyToOdinString(Sec.CopyErrorMessageString(err))
+		fmt.panicf("crypto/rand_bytes: SecRandomCopyBytes returned non-zero result: %v %s", err, msg)
 	}
 	}
 }
 }

+ 15 - 15
core/encoding/cbor/coding.odin

@@ -423,7 +423,7 @@ _decode_bytes :: proc(d: Decoder, add: Add, type: Major = .Bytes, allocator := c
 _encode_bytes :: proc(e: Encoder, val: Bytes, major: Major = .Bytes) -> (err: Encode_Error) {
 _encode_bytes :: proc(e: Encoder, val: Bytes, major: Major = .Bytes) -> (err: Encode_Error) {
 	assert(len(val) >= 0)
 	assert(len(val) >= 0)
 	_encode_u64(e, u64(len(val)), major) or_return
 	_encode_u64(e, u64(len(val)), major) or_return
-    _, err = io.write_full(e.writer, val[:])
+	_, err = io.write_full(e.writer, val[:])
 	return
 	return
 }
 }
 
 
@@ -440,7 +440,7 @@ _decode_text :: proc(d: Decoder, add: Add, allocator := context.allocator, loc :
 }
 }
 
 
 _encode_text :: proc(e: Encoder, val: Text) -> Encode_Error {
 _encode_text :: proc(e: Encoder, val: Text) -> Encode_Error {
-    return _encode_bytes(e, transmute([]byte)val, .Text)
+	return _encode_bytes(e, transmute([]byte)val, .Text)
 }
 }
 
 
 _decode_array_ptr :: proc(d: Decoder, add: Add, allocator := context.allocator, loc := #caller_location) -> (v: ^Array, err: Decode_Error) {
 _decode_array_ptr :: proc(d: Decoder, add: Add, allocator := context.allocator, loc := #caller_location) -> (v: ^Array, err: Decode_Error) {
@@ -480,10 +480,10 @@ _decode_array :: proc(d: Decoder, add: Add, allocator := context.allocator, loc
 _encode_array :: proc(e: Encoder, arr: Array) -> Encode_Error {
 _encode_array :: proc(e: Encoder, arr: Array) -> Encode_Error {
 	assert(len(arr) >= 0)
 	assert(len(arr) >= 0)
 	_encode_u64(e, u64(len(arr)), .Array)
 	_encode_u64(e, u64(len(arr)), .Array)
-    for val in arr {
-        encode(e, val) or_return
-    }
-    return nil
+	for val in arr {
+		encode(e, val) or_return
+	}
+	return nil
 }
 }
 
 
 _decode_map_ptr :: proc(d: Decoder, add: Add, allocator := context.allocator, loc := #caller_location) -> (v: ^Map, err: Decode_Error) {
 _decode_map_ptr :: proc(d: Decoder, add: Add, allocator := context.allocator, loc := #caller_location) -> (v: ^Map, err: Decode_Error) {
@@ -576,7 +576,7 @@ _encode_map :: proc(e: Encoder, m: Map) -> (err: Encode_Error) {
 		encode(e, entry.entry.value) or_return
 		encode(e, entry.entry.value) or_return
 	}
 	}
 
 
-    return nil
+	return nil
 }
 }
 
 
 _decode_tag_ptr :: proc(d: Decoder, add: Add, allocator := context.allocator, loc := #caller_location) -> (v: Value, err: Decode_Error) {
 _decode_tag_ptr :: proc(d: Decoder, add: Add, allocator := context.allocator, loc := #caller_location) -> (v: Value, err: Decode_Error) {
@@ -626,7 +626,7 @@ _decode_uint_as_u64 :: proc(r: io.Reader, add: Add) -> (nr: u64, err: Decode_Err
 
 
 _encode_tag :: proc(e: Encoder, val: Tag) -> Encode_Error {
 _encode_tag :: proc(e: Encoder, val: Tag) -> Encode_Error {
 	_encode_u64(e, val.number, .Tag) or_return
 	_encode_u64(e, val.number, .Tag) or_return
-    return encode(e, val.value)
+	return encode(e, val.value)
 }
 }
 
 
 _decode_simple :: proc(r: io.Reader) -> (v: Simple, err: io.Error) {
 _decode_simple :: proc(r: io.Reader) -> (v: Simple, err: io.Error) {
@@ -739,16 +739,16 @@ _encode_nil :: proc(w: io.Writer) -> io.Error {
 // Streaming
 // Streaming
 
 
 encode_stream_begin :: proc(w: io.Writer, major: Major) -> (err: io.Error) {
 encode_stream_begin :: proc(w: io.Writer, major: Major) -> (err: io.Error) {
-    assert(major >= Major(.Bytes) && major <= Major(.Map), "illegal stream type")
+	assert(major >= Major(.Bytes) && major <= Major(.Map), "illegal stream type")
 
 
-    header := (u8(major) << 5) | u8(Add.Length_Unknown)
-    _, err = io.write_full(w, {header})
+	header := (u8(major) << 5) | u8(Add.Length_Unknown)
+	_, err = io.write_full(w, {header})
 	return
 	return
 }
 }
 
 
 encode_stream_end :: proc(w: io.Writer) -> io.Error {
 encode_stream_end :: proc(w: io.Writer) -> io.Error {
-    header := (u8(Major.Other) << 5) | u8(Add.Break)
-    _, err := io.write_full(w, {header})
+	header := (u8(Major.Other) << 5) | u8(Add.Break)
+	_, err := io.write_full(w, {header})
 	return err
 	return err
 }
 }
 
 
@@ -757,8 +757,8 @@ encode_stream_text       :: _encode_text
 encode_stream_array_item :: encode
 encode_stream_array_item :: encode
 
 
 encode_stream_map_entry :: proc(e: Encoder, key: Value, val: Value) -> Encode_Error {
 encode_stream_map_entry :: proc(e: Encoder, key: Value, val: Value) -> Encode_Error {
-    encode(e, key) or_return
-    return encode(e, val)
+	encode(e, key) or_return
+	return encode(e, val)
 }
 }
 
 
 // For `Bytes` and `Text` strings: Decodes the number of items the header says follows.
 // For `Bytes` and `Text` strings: Decodes the number of items the header says follows.

+ 7 - 7
core/encoding/cbor/unmarshal.odin

@@ -273,13 +273,13 @@ _unmarshal_value :: proc(d: Decoder, v: any, hdr: Header, allocator := context.a
 
 
 		 // NOTE: Because this is a special type and not to be treated as a general integer,
 		 // NOTE: Because this is a special type and not to be treated as a general integer,
 		 // We only put the value of it in fields that are explicitly of type `Simple`.
 		 // We only put the value of it in fields that are explicitly of type `Simple`.
-		 switch &dst in v {
-		 case Simple:
-			 dst = decoded
-			 return
-		 case:
-		 	return _unsupported(v, hdr, add)
-		 }
+		switch &dst in v {
+		case Simple:
+			dst = decoded
+			return
+		case:
+			return _unsupported(v, hdr, add)
+		}
 
 
 	case .Tag:
 	case .Tag:
 		switch &dst in v {
 		switch &dst in v {

+ 4 - 4
core/encoding/json/marshal.odin

@@ -387,17 +387,17 @@ marshal_to_writer :: proc(w: io.Writer, v: any, opt: ^Marshal_Options) -> (err:
 			case runtime.Type_Info_Pointer,
 			case runtime.Type_Info_Pointer,
 			     runtime.Type_Info_Multi_Pointer,
 			     runtime.Type_Info_Multi_Pointer,
 			     runtime.Type_Info_Procedure:
 			     runtime.Type_Info_Procedure:
-			     	return (^rawptr)(v.data)^ == nil
+				return (^rawptr)(v.data)^ == nil
 			case runtime.Type_Info_Dynamic_Array:
 			case runtime.Type_Info_Dynamic_Array:
-			     	return (^runtime.Raw_Dynamic_Array)(v.data).len == 0
+				return (^runtime.Raw_Dynamic_Array)(v.data).len == 0
 			case runtime.Type_Info_Slice:
 			case runtime.Type_Info_Slice:
-			     	return (^runtime.Raw_Slice)(v.data).len == 0
+				return (^runtime.Raw_Slice)(v.data).len == 0
 			case runtime.Type_Info_Union,
 			case runtime.Type_Info_Union,
 			     runtime.Type_Info_Bit_Set,
 			     runtime.Type_Info_Bit_Set,
 			     runtime.Type_Info_Soa_Pointer:
 			     runtime.Type_Info_Soa_Pointer:
 				return reflect.is_nil(v)
 				return reflect.is_nil(v)
 			case runtime.Type_Info_Map:
 			case runtime.Type_Info_Map:
-			     	return (^runtime.Raw_Map)(v.data).len == 0
+				return (^runtime.Raw_Map)(v.data).len == 0
 			}
 			}
 			return false
 			return false
 		}
 		}

+ 5 - 5
core/encoding/xml/debug_print.odin

@@ -33,7 +33,7 @@ print :: proc(writer: io.Writer, doc: ^Document) -> (written: int, err: io.Error
 		written += fmt.wprintf(writer, "[DOCTYPE]  %v\n", doc.doctype.ident)
 		written += fmt.wprintf(writer, "[DOCTYPE]  %v\n", doc.doctype.ident)
 
 
 		if len(doc.doctype.rest) > 0 {
 		if len(doc.doctype.rest) > 0 {
-		 	fmt.wprintf(writer, "\t%v\n", doc.doctype.rest)
+			fmt.wprintf(writer, "\t%v\n", doc.doctype.rest)
 		}
 		}
 	}
 	}
 
 
@@ -42,10 +42,10 @@ print :: proc(writer: io.Writer, doc: ^Document) -> (written: int, err: io.Error
 	}
 	}
 
 
 	if len(doc.elements) > 0 {
 	if len(doc.elements) > 0 {
-	 	fmt.wprintln(writer, " --- ")
-	 	print_element(writer, doc, 0)
-	 	fmt.wprintln(writer, " --- ")
-	 }
+		fmt.wprintln(writer, " --- ")
+		print_element(writer, doc, 0)
+		fmt.wprintln(writer, " --- ")
+	}
 
 
 	return written, .None
 	return written, .None
 }
 }

+ 8 - 8
core/fmt/fmt.odin

@@ -92,7 +92,7 @@ _user_formatters: ^map[typeid]User_Formatter
 //
 //
 set_user_formatters :: proc(m: ^map[typeid]User_Formatter) {
 set_user_formatters :: proc(m: ^map[typeid]User_Formatter) {
 	assert(_user_formatters == nil, "set_user_formatters must not be called more than once.")
 	assert(_user_formatters == nil, "set_user_formatters must not be called more than once.")
-    _user_formatters = m
+	_user_formatters = m
 }
 }
 // Registers a user-defined formatter for a specific typeid
 // Registers a user-defined formatter for a specific typeid
 //
 //
@@ -1229,10 +1229,10 @@ _fmt_memory :: proc(fi: ^Info, u: u64, is_signed: bool, bit_size: int, units: st
 	// Add the unit at the end.
 	// Add the unit at the end.
 	copy(buf[len(str):], units[off:off+unit_len])
 	copy(buf[len(str):], units[off:off+unit_len])
 	str = string(buf[:len(str)+unit_len])
 	str = string(buf[:len(str)+unit_len])
-	 
-	 if !fi.plus {
-	 	// Strip sign from "+<value>" but not "+Inf".
-	 	if str[0] == '+' && str[1] != 'I' {
+
+	if !fi.plus {
+		// Strip sign from "+<value>" but not "+Inf".
+		if str[0] == '+' && str[1] != 'I' {
 			str = str[1:] 
 			str = str[1:] 
 		}
 		}
 	}
 	}
@@ -1765,7 +1765,7 @@ fmt_bit_set :: proc(fi: ^Info, v: any, name: string = "", verb: rune = 'v') {
 
 
 			if is_enum {
 			if is_enum {
 				enum_name: string
 				enum_name: string
-			 	if ti_named, is_named := info.elem.variant.(runtime.Type_Info_Named); is_named {
+				if ti_named, is_named := info.elem.variant.(runtime.Type_Info_Named); is_named {
 					enum_name = ti_named.name
 					enum_name = ti_named.name
 				}
 				}
 				for ev, evi in e.values {
 				for ev, evi in e.values {
@@ -2709,7 +2709,7 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) {
 							return
 							return
 						}
 						}
 						if fi.indirection_level < 1 {
 						if fi.indirection_level < 1 {
-						  	fi.indirection_level += 1
+							fi.indirection_level += 1
 							defer fi.indirection_level -= 1
 							defer fi.indirection_level -= 1
 							io.write_byte(fi.writer, '&')
 							io.write_byte(fi.writer, '&')
 							fmt_value(fi, a, verb)
 							fmt_value(fi, a, verb)
@@ -2778,7 +2778,7 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) {
 				     runtime.Type_Info_Dynamic_Array,
 				     runtime.Type_Info_Dynamic_Array,
 				     runtime.Type_Info_Map:
 				     runtime.Type_Info_Map:
 					if fi.indirection_level < 1 {
 					if fi.indirection_level < 1 {
-					  	fi.indirection_level += 1
+						fi.indirection_level += 1
 						defer fi.indirection_level -= 1
 						defer fi.indirection_level -= 1
 						io.write_byte(fi.writer, '&', &fi.n)
 						io.write_byte(fi.writer, '&', &fi.n)
 						fmt_value(fi, a, verb)
 						fmt_value(fi, a, verb)

+ 2 - 2
core/image/bmp/bmp.odin

@@ -71,7 +71,7 @@ save_to_buffer  :: proc(output: ^bytes.Buffer, img: ^Image, options := Options{}
 	written := 0
 	written := 0
 
 
 	if resize(&output.buf, int(header.size)) != nil {
 	if resize(&output.buf, int(header.size)) != nil {
-	 	return .Unable_To_Allocate_Or_Resize
+		return .Unable_To_Allocate_Or_Resize
 	}
 	}
 
 
 	header_bytes := transmute([size_of(image.BMP_Header)]u8)header
 	header_bytes := transmute([size_of(image.BMP_Header)]u8)header
@@ -735,7 +735,7 @@ destroy :: proc(img: ^Image) {
 
 
 	bytes.buffer_destroy(&img.pixels)
 	bytes.buffer_destroy(&img.pixels)
 	if v, ok := img.metadata.(^image.BMP_Info); ok {
 	if v, ok := img.metadata.(^image.BMP_Info); ok {
-	 	free(v)
+		free(v)
 	}
 	}
 	free(img)
 	free(img)
 }
 }

+ 2 - 2
core/image/qoi/qoi.odin

@@ -230,7 +230,7 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a
 	bytes_needed := image.compute_buffer_size(int(header.width), int(header.height), img.channels, 8)
 	bytes_needed := image.compute_buffer_size(int(header.width), int(header.height), img.channels, 8)
 
 
 	if resize(&img.pixels.buf, bytes_needed) != nil {
 	if resize(&img.pixels.buf, bytes_needed) != nil {
-	 	return img, .Unable_To_Allocate_Or_Resize
+		return img, .Unable_To_Allocate_Or_Resize
 	}
 	}
 
 
 	/*
 	/*
@@ -341,7 +341,7 @@ destroy :: proc(img: ^Image) {
 	bytes.buffer_destroy(&img.pixels)
 	bytes.buffer_destroy(&img.pixels)
 
 
 	if v, ok := img.metadata.(^image.QOI_Info); ok {
 	if v, ok := img.metadata.(^image.QOI_Info); ok {
-	 	free(v)
+		free(v)
 	}
 	}
 	free(img)
 	free(img)
 }
 }

+ 23 - 23
core/math/big/private.odin

@@ -787,8 +787,8 @@ _private_int_sqr_comba :: proc(dest, src: ^Int, allocator := context.allocator)
 /*
 /*
 	Karatsuba squaring, computes `dest` = `src` * `src` using three half-size squarings.
 	Karatsuba squaring, computes `dest` = `src` * `src` using three half-size squarings.
  
  
- 	See comments of `_private_int_mul_karatsuba` for details.
- 	It is essentially the same algorithm but merely tuned to perform recursive squarings.
+	See comments of `_private_int_mul_karatsuba` for details.
+	It is essentially the same algorithm but merely tuned to perform recursive squarings.
 */
 */
 _private_int_sqr_karatsuba :: proc(dest, src: ^Int, allocator := context.allocator) -> (err: Error) {
 _private_int_sqr_karatsuba :: proc(dest, src: ^Int, allocator := context.allocator) -> (err: Error) {
 	context.allocator = allocator
 	context.allocator = allocator
@@ -967,7 +967,7 @@ _private_int_div_3 :: proc(quotient, numerator: ^Int, allocator := context.alloc
 	/*
 	/*
 		b = 2^_DIGIT_BITS / 3
 		b = 2^_DIGIT_BITS / 3
 	*/
 	*/
- 	b := _WORD(1) << _WORD(_DIGIT_BITS) / _WORD(3)
+	b := _WORD(1) << _WORD(_DIGIT_BITS) / _WORD(3)
 
 
 	q := &Int{}
 	q := &Int{}
 	internal_grow(q, numerator.used) or_return
 	internal_grow(q, numerator.used) or_return
@@ -1007,8 +1007,8 @@ _private_int_div_3 :: proc(quotient, numerator: ^Int, allocator := context.alloc
 	*/
 	*/
 	if quotient != nil {
 	if quotient != nil {
 		err = clamp(q)
 		err = clamp(q)
- 		internal_swap(q, quotient)
- 	}
+		internal_swap(q, quotient)
+	}
 	internal_destroy(q)
 	internal_destroy(q)
 	return remainder, nil
 	return remainder, nil
 }
 }
@@ -1555,24 +1555,24 @@ _private_int_gcd_lcm :: proc(res_gcd, res_lcm, a, b: ^Int, allocator := context.
 
 
 	/*
 	/*
 		If neither `a` or `b` was zero, we need to compute `gcd`.
 		If neither `a` or `b` was zero, we need to compute `gcd`.
- 		Get copies of `a` and `b` we can modify.
- 	*/
+		Get copies of `a` and `b` we can modify.
+	*/
 	u, v := &Int{}, &Int{}
 	u, v := &Int{}, &Int{}
 	defer internal_destroy(u, v)
 	defer internal_destroy(u, v)
 	internal_copy(u, a) or_return
 	internal_copy(u, a) or_return
 	internal_copy(v, b) or_return
 	internal_copy(v, b) or_return
 
 
- 	/*
- 		Must be positive for the remainder of the algorithm.
- 	*/
+	/*
+		Must be positive for the remainder of the algorithm.
+	*/
 	u.sign = .Zero_or_Positive; v.sign = .Zero_or_Positive
 	u.sign = .Zero_or_Positive; v.sign = .Zero_or_Positive
 
 
- 	/*
- 		B1.  Find the common power of two for `u` and `v`.
- 	*/
- 	u_lsb, _ := internal_count_lsb(u)
- 	v_lsb, _ := internal_count_lsb(v)
- 	k        := min(u_lsb, v_lsb)
+	/*
+		B1.  Find the common power of two for `u` and `v`.
+	*/
+	u_lsb, _ := internal_count_lsb(u)
+	v_lsb, _ := internal_count_lsb(v)
+	k        := min(u_lsb, v_lsb)
 
 
 	if k > 0 {
 	if k > 0 {
 		/*
 		/*
@@ -1615,11 +1615,11 @@ _private_int_gcd_lcm :: proc(res_gcd, res_lcm, a, b: ^Int, allocator := context.
 		internal_shr(v, v, b) or_return
 		internal_shr(v, v, b) or_return
 	}
 	}
 
 
- 	/*
- 		Multiply by 2**k which we divided out at the beginning.
- 	*/
- 	internal_shl(temp_gcd_res, u, k) or_return
- 	temp_gcd_res.sign = .Zero_or_Positive
+	/*
+		Multiply by 2**k which we divided out at the beginning.
+	*/
+	internal_shl(temp_gcd_res, u, k) or_return
+	temp_gcd_res.sign = .Zero_or_Positive
 
 
 	/*
 	/*
 		We've computed `gcd`, either the long way, or because one of the inputs was zero.
 		We've computed `gcd`, either the long way, or because one of the inputs was zero.
@@ -1786,8 +1786,8 @@ _private_montgomery_reduce_comba :: proc(x, n: ^Int, rho: DIGIT, allocator := co
 			`a = a + mu * m * b**i`
 			`a = a + mu * m * b**i`
 		
 		
 			This is computed in place and on the fly.  The multiplication
 			This is computed in place and on the fly.  The multiplication
-		 	by b**i is handled by offseting which columns the results
-		 	are added to.
+			by b**i is handled by offseting which columns the results
+			are added to.
 		
 		
 			Note the comba method normally doesn't handle carries in the
 			Note the comba method normally doesn't handle carries in the
 			inner loop In this case we fix the carry from the previous
 			inner loop In this case we fix the carry from the previous

+ 1 - 1
core/mem/tlsf/tlsf_internal.odin

@@ -214,7 +214,7 @@ block_next :: proc(block: ^Block_Header) -> (next: ^Block_Header) {
 block_link_next :: proc(block: ^Block_Header) -> (next: ^Block_Header) {
 block_link_next :: proc(block: ^Block_Header) -> (next: ^Block_Header) {
 	next = block_next(block)
 	next = block_next(block)
 	next.prev_phys_block = block
 	next.prev_phys_block = block
- 	return
+	return
 }
 }
 
 
 block_mark_as_free :: proc(block: ^Block_Header) {
 block_mark_as_free :: proc(block: ^Block_Header) {

+ 13 - 16
core/net/interface_darwin.odin

@@ -59,24 +59,21 @@ _enumerate_interfaces :: proc(allocator := context.allocator) -> (interfaces: []
 			switch int(ifaddr.address.family) {
 			switch int(ifaddr.address.family) {
 			case os.AF_INET, os.AF_INET6:
 			case os.AF_INET, os.AF_INET6:
 				address = _sockaddr_basic_to_endpoint(ifaddr.address).address
 				address = _sockaddr_basic_to_endpoint(ifaddr.address).address
-			case:
 			}
 			}
 		}
 		}
 
 
 		if ifaddr.netmask != nil {
 		if ifaddr.netmask != nil {
 			switch int(ifaddr.netmask.family) {
 			switch int(ifaddr.netmask.family) {
 			case os.AF_INET, os.AF_INET6:
 			case os.AF_INET, os.AF_INET6:
-			 	netmask = Netmask(_sockaddr_basic_to_endpoint(ifaddr.netmask).address)
-			case:
+				netmask = Netmask(_sockaddr_basic_to_endpoint(ifaddr.netmask).address)
 			}
 			}
 		}
 		}
 
 
 		if ifaddr.broadcast_or_dest != nil && .BROADCAST in ifaddr.flags {
 		if ifaddr.broadcast_or_dest != nil && .BROADCAST in ifaddr.flags {
 			switch int(ifaddr.broadcast_or_dest.family) {
 			switch int(ifaddr.broadcast_or_dest.family) {
 			case os.AF_INET, os.AF_INET6:
 			case os.AF_INET, os.AF_INET6:
-			 	broadcast := _sockaddr_basic_to_endpoint(ifaddr.broadcast_or_dest).address
-			 	append(&iface.multicast, broadcast)
-			case:
+				broadcast := _sockaddr_basic_to_endpoint(ifaddr.broadcast_or_dest).address
+				append(&iface.multicast, broadcast)
 			}
 			}
 		}
 		}
 
 
@@ -91,19 +88,19 @@ _enumerate_interfaces :: proc(allocator := context.allocator) -> (interfaces: []
 		/*
 		/*
 			TODO: Refine this based on the type of adapter.
 			TODO: Refine this based on the type of adapter.
 		*/
 		*/
- 		state := Link_State{}
+		state := Link_State{}
 
 
- 		if .UP in ifaddr.flags {
- 			state += {.Up}
- 		}
+		if .UP in ifaddr.flags {
+			state += {.Up}
+		}
 
 
- 		/*if .DORMANT in ifaddr.flags {
- 			state |= {.Dormant}
- 		}*/
+		/*if .DORMANT in ifaddr.flags {
+			state |= {.Dormant}
+		}*/
 
 
- 		if .LOOPBACK in ifaddr.flags {
- 			state += {.Loopback}
- 		}
+		if .LOOPBACK in ifaddr.flags {
+			state += {.Loopback}
+		}
 		iface.link.state = state
 		iface.link.state = state
 	}
 	}
 
 

+ 89 - 89
core/net/interface_windows.odin

@@ -24,42 +24,42 @@ import strings "core:strings"
 _enumerate_interfaces :: proc(allocator := context.allocator) -> (interfaces: []Network_Interface, err: Network_Error) {
 _enumerate_interfaces :: proc(allocator := context.allocator) -> (interfaces: []Network_Interface, err: Network_Error) {
 	context.allocator = allocator
 	context.allocator = allocator
 
 
- 	buf:      []u8
- 	defer delete(buf)
+	buf:      []u8
+	defer delete(buf)
 
 
- 	buf_size: u32
- 	res:      u32
+	buf_size: u32
+	res:      u32
 
 
- 	gaa: for _ in 1..=MAX_INTERFACE_ENUMERATION_TRIES {
- 	 	res = sys.get_adapters_addresses(
- 			.Unspecified, // Return both IPv4 and IPv6 adapters.
+	gaa: for _ in 1..=MAX_INTERFACE_ENUMERATION_TRIES {
+		res = sys.get_adapters_addresses(
+			.Unspecified, // Return both IPv4 and IPv6 adapters.
 			sys.GAA_Flags{
 			sys.GAA_Flags{
 				.Include_Prefix,               // (XP SP1+) Return a list of IP address prefixes on this adapter. When this flag is set, IP address prefixes are returned for both IPv6 and IPv4 addresses.
 				.Include_Prefix,               // (XP SP1+) Return a list of IP address prefixes on this adapter. When this flag is set, IP address prefixes are returned for both IPv6 and IPv4 addresses.
 				.Include_Gateways,             // (Vista+) Return the addresses of default gateways.
 				.Include_Gateways,             // (Vista+) Return the addresses of default gateways.
 				.Include_Tunnel_Binding_Order, // (Vista+) Return the adapter addresses sorted in tunnel binding order.
 				.Include_Tunnel_Binding_Order, // (Vista+) Return the adapter addresses sorted in tunnel binding order.
 			},
 			},
- 			nil,          // Reserved
- 			(^sys.IP_Adapter_Addresses)(raw_data(buf)),
- 			&buf_size,
- 		)
-
- 	 	switch res {
- 	 	case 111: // ERROR_BUFFER_OVERFLOW:
- 	 		delete(buf)
- 	 		buf = make([]u8, buf_size)
- 	 	case 0:
- 	 		break gaa
- 	 	case:
- 	 		return {}, Platform_Error(res)
- 	 	}
- 	}
-
- 	if res != 0 {
- 		return {}, .Unable_To_Enumerate_Network_Interfaces
- 	}
-
- 	_interfaces := make([dynamic]Network_Interface, 0, allocator)
- 	for adapter := (^sys.IP_Adapter_Addresses)(raw_data(buf)); adapter != nil; adapter = adapter.Next {
+			nil,          // Reserved
+			(^sys.IP_Adapter_Addresses)(raw_data(buf)),
+			&buf_size,
+		)
+
+		switch res {
+		case 111: // ERROR_BUFFER_OVERFLOW:
+			delete(buf)
+			buf = make([]u8, buf_size)
+		case 0:
+			break gaa
+		case:
+			return {}, Platform_Error(res)
+		}
+	}
+
+	if res != 0 {
+		return {}, .Unable_To_Enumerate_Network_Interfaces
+	}
+
+	_interfaces := make([dynamic]Network_Interface, 0, allocator)
+	for adapter := (^sys.IP_Adapter_Addresses)(raw_data(buf)); adapter != nil; adapter = adapter.Next {
 		friendly_name, err1 := sys.wstring_to_utf8(sys.wstring(adapter.FriendlyName), 256, allocator)
 		friendly_name, err1 := sys.wstring_to_utf8(sys.wstring(adapter.FriendlyName), 256, allocator)
 		if err1 != nil { return {}, Platform_Error(err1) }
 		if err1 != nil { return {}, Platform_Error(err1) }
 
 
@@ -71,74 +71,74 @@ _enumerate_interfaces :: proc(allocator := context.allocator) -> (interfaces: []
 
 
 		interface := Network_Interface{
 		interface := Network_Interface{
 			adapter_name  = strings.clone(string(adapter.AdapterName)),
 			adapter_name  = strings.clone(string(adapter.AdapterName)),
- 			friendly_name = friendly_name,
- 			description   = description,
- 			dns_suffix    = dns_suffix,
+			friendly_name = friendly_name,
+			description   = description,
+			dns_suffix    = dns_suffix,
 
 
- 			mtu  = adapter.MTU,
+			mtu  = adapter.MTU,
 
 
- 			link = {
+			link = {
 				transmit_speed = adapter.TransmitLinkSpeed,
 				transmit_speed = adapter.TransmitLinkSpeed,
 				receive_speed  = adapter.ReceiveLinkSpeed,
 				receive_speed  = adapter.ReceiveLinkSpeed,
- 			},
- 		}
-
- 		if adapter.PhysicalAddressLength > 0 && adapter.PhysicalAddressLength <= len(adapter.PhysicalAddress) {
- 			interface.physical_address = physical_address_to_string(adapter.PhysicalAddress[:adapter.PhysicalAddressLength])
- 		}
-
- 		for u_addr := (^sys.IP_ADAPTER_UNICAST_ADDRESS_LH)(adapter.FirstUnicastAddress); u_addr != nil; u_addr = u_addr.Next {
- 			win_addr := parse_socket_address(u_addr.Address)
-
- 			lease := Lease{
- 				address = win_addr.address,
- 				origin  = {
- 					prefix = Prefix_Origin(u_addr.PrefixOrigin),
- 					suffix = Suffix_Origin(u_addr.SuffixOrigin),
- 				},
- 				lifetime = {
- 					valid     = u_addr.ValidLifetime,
- 					preferred = u_addr.PreferredLifetime,
- 					lease     = u_addr.LeaseLifetime,
- 				},
- 				address_duplication = Address_Duplication(u_addr.DadState),
- 			}
- 			append(&interface.unicast, lease)
- 		}
-
- 		for a_addr := (^sys.IP_ADAPTER_ANYCAST_ADDRESS_XP)(adapter.FirstAnycastAddress); a_addr != nil; a_addr = a_addr.Next {
- 			addr := parse_socket_address(a_addr.Address)
- 			append(&interface.anycast, addr.address)
- 		}
-
- 		for m_addr := (^sys.IP_ADAPTER_MULTICAST_ADDRESS_XP)(adapter.FirstMulticastAddress); m_addr != nil; m_addr = m_addr.Next {
- 			addr := parse_socket_address(m_addr.Address)
- 			append(&interface.multicast, addr.address)
- 		}
-
- 		for g_addr := (^sys.IP_ADAPTER_GATEWAY_ADDRESS_LH)(adapter.FirstGatewayAddress); g_addr != nil; g_addr = g_addr.Next {
- 			addr := parse_socket_address(g_addr.Address)
- 			append(&interface.gateways, addr.address)
- 		}
+			},
+		}
+
+		if adapter.PhysicalAddressLength > 0 && adapter.PhysicalAddressLength <= len(adapter.PhysicalAddress) {
+			interface.physical_address = physical_address_to_string(adapter.PhysicalAddress[:adapter.PhysicalAddressLength])
+		}
+
+		for u_addr := (^sys.IP_ADAPTER_UNICAST_ADDRESS_LH)(adapter.FirstUnicastAddress); u_addr != nil; u_addr = u_addr.Next {
+			win_addr := parse_socket_address(u_addr.Address)
+
+			lease := Lease{
+				address = win_addr.address,
+				origin  = {
+					prefix = Prefix_Origin(u_addr.PrefixOrigin),
+					suffix = Suffix_Origin(u_addr.SuffixOrigin),
+				},
+				lifetime = {
+					valid     = u_addr.ValidLifetime,
+					preferred = u_addr.PreferredLifetime,
+					lease     = u_addr.LeaseLifetime,
+				},
+				address_duplication = Address_Duplication(u_addr.DadState),
+			}
+			append(&interface.unicast, lease)
+		}
+
+		for a_addr := (^sys.IP_ADAPTER_ANYCAST_ADDRESS_XP)(adapter.FirstAnycastAddress); a_addr != nil; a_addr = a_addr.Next {
+			addr := parse_socket_address(a_addr.Address)
+			append(&interface.anycast, addr.address)
+		}
+
+		for m_addr := (^sys.IP_ADAPTER_MULTICAST_ADDRESS_XP)(adapter.FirstMulticastAddress); m_addr != nil; m_addr = m_addr.Next {
+			addr := parse_socket_address(m_addr.Address)
+			append(&interface.multicast, addr.address)
+		}
+
+		for g_addr := (^sys.IP_ADAPTER_GATEWAY_ADDRESS_LH)(adapter.FirstGatewayAddress); g_addr != nil; g_addr = g_addr.Next {
+			addr := parse_socket_address(g_addr.Address)
+			append(&interface.gateways, addr.address)
+		}
 
 
 		interface.dhcp_v4 = parse_socket_address(adapter.Dhcpv4Server).address
 		interface.dhcp_v4 = parse_socket_address(adapter.Dhcpv4Server).address
 		interface.dhcp_v6 = parse_socket_address(adapter.Dhcpv6Server).address
 		interface.dhcp_v6 = parse_socket_address(adapter.Dhcpv6Server).address
 
 
- 		switch adapter.OperStatus {
- 		case .Up:             interface.link.state = {.Up}
- 		case .Down:           interface.link.state = {.Down}
- 		case .Testing:        interface.link.state = {.Testing}
- 		case .Dormant:        interface.link.state = {.Dormant}
- 		case .NotPresent:     interface.link.state = {.Not_Present}
- 		case .LowerLayerDown: interface.link.state = {.Lower_Layer_Down}
- 		case .Unknown:        fallthrough
- 		case:                 interface.link.state = {}
- 		}
-
- 		interface.tunnel_type = Tunnel_Type(adapter.TunnelType)
-
- 		append(&_interfaces, interface)
- 	}
+		switch adapter.OperStatus {
+		case .Up:             interface.link.state = {.Up}
+		case .Down:           interface.link.state = {.Down}
+		case .Testing:        interface.link.state = {.Testing}
+		case .Dormant:        interface.link.state = {.Dormant}
+		case .NotPresent:     interface.link.state = {.Not_Present}
+		case .LowerLayerDown: interface.link.state = {.Lower_Layer_Down}
+		case .Unknown:        fallthrough
+		case:                 interface.link.state = {}
+		}
+
+		interface.tunnel_type = Tunnel_Type(adapter.TunnelType)
+
+		append(&_interfaces, interface)
+	}
 
 
 	return _interfaces[:], {}
 	return _interfaces[:], {}
 }
 }

+ 9 - 9
core/odin/parser/parser.odin

@@ -308,7 +308,7 @@ consume_comment_group :: proc(p: ^Parser, n: int) -> (comments: ^ast.Comment_Gro
 	end_line = p.curr_tok.pos.line
 	end_line = p.curr_tok.pos.line
 	for p.curr_tok.kind == .Comment &&
 	for p.curr_tok.kind == .Comment &&
 	    p.curr_tok.pos.line <= end_line+n {
 	    p.curr_tok.pos.line <= end_line+n {
-	    comment: tokenizer.Token
+		comment: tokenizer.Token
 		comment, end_line = consume_comment(p)
 		comment, end_line = consume_comment(p)
 		append(&list, comment)
 		append(&list, comment)
 	}
 	}
@@ -1315,8 +1315,8 @@ parse_stmt :: proc(p: ^Parser) -> ^ast.Stmt {
 	     // Unary Expressions
 	     // Unary Expressions
 	     .Add, .Sub, .Xor, .Not, .And:
 	     .Add, .Sub, .Xor, .Not, .And:
 
 
-	    s := parse_simple_stmt(p, {Stmt_Allow_Flag.Label})
-	    expect_semicolon(p, s)
+		s := parse_simple_stmt(p, {Stmt_Allow_Flag.Label})
+		expect_semicolon(p, s)
 		return s
 		return s
 
 
 
 
@@ -1853,7 +1853,7 @@ parse_ident_list :: proc(p: ^Parser, allow_poly_names: bool) -> []^ast.Expr {
 		}
 		}
 		if p.curr_tok.kind != .Comma ||
 		if p.curr_tok.kind != .Comma ||
 		   p.curr_tok.kind == .EOF {
 		   p.curr_tok.kind == .EOF {
-		   	break
+			break
 		}
 		}
 		advance_token(p)
 		advance_token(p)
 	}
 	}
@@ -2216,10 +2216,10 @@ parse_operand :: proc(p: ^Parser, lhs: bool) -> ^ast.Expr {
 
 
 	case .Integer, .Float, .Imag,
 	case .Integer, .Float, .Imag,
 	     .Rune, .String:
 	     .Rune, .String:
-	     tok := advance_token(p)
-	     bl := ast.new(ast.Basic_Lit, tok.pos, end_pos(tok))
-	     bl.tok = tok
-	     return bl
+		tok := advance_token(p)
+		bl := ast.new(ast.Basic_Lit, tok.pos, end_pos(tok))
+		bl.tok = tok
+		return bl
 
 
 	case .Open_Brace:
 	case .Open_Brace:
 		if !lhs {
 		if !lhs {
@@ -3007,7 +3007,7 @@ parse_literal_value :: proc(p: ^Parser, type: ^ast.Expr) -> ^ast.Comp_Lit {
 	}
 	}
 	p.expr_level -= 1
 	p.expr_level -= 1
 
 
-  	skip_possible_newline(p)
+	skip_possible_newline(p)
 	close := expect_closing_brace_of_field_list(p)
 	close := expect_closing_brace_of_field_list(p)
 
 
 	pos := type.pos if type != nil else open.pos
 	pos := type.pos if type != nil else open.pos

+ 2 - 2
core/os/os.odin

@@ -111,7 +111,7 @@ read_entire_file_from_handle :: proc(fd: Handle, allocator := context.allocator,
 	length: i64
 	length: i64
 	err: Errno
 	err: Errno
 	if length, err = file_size(fd); err != 0 {
 	if length, err = file_size(fd); err != 0 {
-	    return nil, false
+		return nil, false
 	}
 	}
 
 
 	if length <= 0 {
 	if length <= 0 {
@@ -120,7 +120,7 @@ read_entire_file_from_handle :: proc(fd: Handle, allocator := context.allocator,
 
 
 	data = make([]byte, int(length), allocator, loc)
 	data = make([]byte, int(length), allocator, loc)
 	if data == nil {
 	if data == nil {
-	    return nil, false
+		return nil, false
 	}
 	}
 
 
 	bytes_read, read_err := read_full(fd, data)
 	bytes_read, read_err := read_full(fd, data)

+ 1 - 1
core/os/os_darwin.odin

@@ -896,7 +896,7 @@ access :: proc(path: string, mask: int) -> bool {
 }
 }
 
 
 flush :: proc(fd: Handle) -> Errno {
 flush :: proc(fd: Handle) -> Errno {
-    return cast(Errno)_unix_fsync(fd)
+	return cast(Errno)_unix_fsync(fd)
 }
 }
 
 
 lookup_env :: proc(key: string, allocator := context.allocator) -> (value: string, found: bool) {
 lookup_env :: proc(key: string, allocator := context.allocator) -> (value: string, found: bool) {

+ 2 - 2
core/os/os_windows.odin

@@ -178,8 +178,8 @@ WINDOWS_11_BUILD_CUTOFF :: 22_000
 get_windows_version_w :: proc() -> win32.OSVERSIONINFOEXW {
 get_windows_version_w :: proc() -> win32.OSVERSIONINFOEXW {
 	osvi : win32.OSVERSIONINFOEXW
 	osvi : win32.OSVERSIONINFOEXW
 	osvi.dwOSVersionInfoSize = size_of(win32.OSVERSIONINFOEXW)
 	osvi.dwOSVersionInfoSize = size_of(win32.OSVERSIONINFOEXW)
-    win32.RtlGetVersion(&osvi)
-    return osvi
+	win32.RtlGetVersion(&osvi)
+	return osvi
 }
 }
 
 
 is_windows_xp :: proc() -> bool {
 is_windows_xp :: proc() -> bool {

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

@@ -432,7 +432,7 @@ rel :: proc(base_path, target_path: string, allocator := context.allocator) -> (
 	then `"."` is returned.
 	then `"."` is returned.
 */
 */
 dir :: proc(path: string, allocator := context.allocator) -> string {
 dir :: proc(path: string, allocator := context.allocator) -> string {
-        context.allocator = allocator
+	context.allocator = allocator
 	vol := volume_name(path)
 	vol := volume_name(path)
 	i := len(path) - 1
 	i := len(path) - 1
 	for i >= len(vol) && !is_separator(path[i]) {
 	for i >= len(vol) && !is_separator(path[i]) {

+ 2 - 2
core/reflect/types.odin

@@ -114,7 +114,7 @@ are_types_identical :: proc(a, b: ^Type_Info) -> bool {
 
 
 	case Type_Info_Struct:
 	case Type_Info_Struct:
 		y := b.variant.(Type_Info_Struct) or_return
 		y := b.variant.(Type_Info_Struct) or_return
-	   	switch {
+		switch {
 		case len(x.types)    != len(y.types),
 		case len(x.types)    != len(y.types),
 		     x.is_packed     != y.is_packed,
 		     x.is_packed     != y.is_packed,
 		     x.is_raw_union  != y.is_raw_union,
 		     x.is_raw_union  != y.is_raw_union,
@@ -122,7 +122,7 @@ are_types_identical :: proc(a, b: ^Type_Info) -> bool {
 		     x.soa_kind      != y.soa_kind,
 		     x.soa_kind      != y.soa_kind,
 		     x.soa_base_type != y.soa_base_type,
 		     x.soa_base_type != y.soa_base_type,
 		     x.soa_len       != y.soa_len:
 		     x.soa_len       != y.soa_len:
-		     return false
+			return false
 		}
 		}
 		for _, i in x.types {
 		for _, i in x.types {
 			xn, yn := x.names[i], y.names[i]
 			xn, yn := x.names[i], y.names[i]

+ 1 - 1
core/strings/intern.odin

@@ -37,7 +37,7 @@ Returns:
 intern_init :: proc(m: ^Intern, allocator := context.allocator, map_allocator := context.allocator, loc := #caller_location) -> (err: mem.Allocator_Error) {
 intern_init :: proc(m: ^Intern, allocator := context.allocator, map_allocator := context.allocator, loc := #caller_location) -> (err: mem.Allocator_Error) {
 	m.allocator = allocator
 	m.allocator = allocator
 	m.entries = make(map[string]^Intern_Entry, 16, map_allocator, loc) or_return
 	m.entries = make(map[string]^Intern_Entry, 16, map_allocator, loc) or_return
-    return nil
+	return nil
 }
 }
 /*
 /*
 Frees the map and all its content allocated using the `.allocator`.
 Frees the map and all its content allocated using the `.allocator`.

+ 1 - 1
core/sync/chan/chan.odin

@@ -304,7 +304,7 @@ try_recv_raw :: proc "contextless" (c: ^Raw_Chan, msg_out: rawptr) -> bool {
 
 
 		if sync.atomic_load(&c.closed) ||
 		if sync.atomic_load(&c.closed) ||
 		   sync.atomic_load(&c.w_waiting) == 0 {
 		   sync.atomic_load(&c.w_waiting) == 0 {
-		   	return false
+			return false
 		}
 		}
 
 
 		mem.copy(msg_out, c.unbuffered_data, int(c.msg_size))
 		mem.copy(msg_out, c.unbuffered_data, int(c.msg_size))

+ 1 - 1
core/sync/primitives_atomic.odin

@@ -169,7 +169,7 @@ atomic_rw_mutex_shared_unlock :: proc "contextless" (rw: ^Atomic_RW_Mutex) {
 
 
 	if (state & Atomic_RW_Mutex_State_Reader_Mask == Atomic_RW_Mutex_State_Reader) &&
 	if (state & Atomic_RW_Mutex_State_Reader_Mask == Atomic_RW_Mutex_State_Reader) &&
 	   (state & Atomic_RW_Mutex_State_Is_Writing != 0) {
 	   (state & Atomic_RW_Mutex_State_Is_Writing != 0) {
-	   	atomic_sema_post(&rw.sema)
+		atomic_sema_post(&rw.sema)
 	}
 	}
 }
 }
 
 

+ 551 - 551
core/sys/darwin/xnu_system_call_numbers.odin

@@ -1,558 +1,558 @@
 package darwin
 package darwin
 
 
 unix_offset_syscall :: proc "contextless" (number: System_Call_Number) -> uintptr {
 unix_offset_syscall :: proc "contextless" (number: System_Call_Number) -> uintptr {
-    return uintptr(number) + uintptr(0x2000000)
+	return uintptr(number) + uintptr(0x2000000)
 }
 }
 
 
 System_Call_Number :: enum uintptr {
 System_Call_Number :: enum uintptr {
-    /* 0 syscall */
-    exit = 1,
-    fork = 2,
-    read = 3,
-    write = 4,
-    open = 5,
-    close = 6,
-    wait4 = 7,
-    /* 8  old creat */
-    link = 9,
-    unlink = 10,
-    /* 11  old execv */
-    chdir = 12,
-    fchdir = 13,
-    mknod = 14,
-    chmod = 15,
-    chown = 16,
-    /* 17  old break */
-    getfsstat = 18,
-    /* 19  old lseek */
-    getpid = 20,
-    /* 21  old mount */
-    /* 22  old umount */
-    setuid = 23,
-    getuid = 24,
-    geteuid = 25,
-    ptrace = 26,
-    recvmsg = 27,
-    sendmsg = 28,
-    recvfrom = 29,
-    accept = 30,
-    getpeername = 31,
-    getsockname = 32,
-    access = 33,
-    chflags = 34,
-    fchflags = 35,
-    sync = 36,
-    kill = 37,
-    /* 38  old stat */
-    getppid = 39,
-    /* 40  old lstat */
-    dup = 41,
-    pipe = 42,
-    getegid = 43,
-    /* 44  old profil */
-    /* 45  old ktrace */
-    sigaction = 46,
-    getgid = 47,
-    sigprocmask = 48,
-    getlogin = 49,
-    setlogin = 50,
-    acct = 51,
-    sigpending = 52,
-    sigaltstack = 53,
-    ioctl = 54,
-    reboot = 55,
-    revoke = 56,
-    symlink = 57,
-    readlink = 58,
-    execve = 59,
-    umask = 60,
-    chroot = 61,
-    /* 62  old fstat */
-    /* 63  used internally and reserved */
-    /* getpagesize = 64, invalid */
-    msync = 65,
-    vfork = 66,
-    /* 67  old vread */
-    /* 68  old vwrite */
-    /* 69  old sbrk */
-    /* 70  old sstk */
-    /* 71  old mmap */
-    /* 72  old vadvise */
-    munmap = 73,
-    mprotect = 74,
-    madvise = 75,
-    /* 76  old vhangup */
-    /* 77  old vlimit */
-    mincore = 78,
-    getgroups = 79,
-    setgroups = 80,
-    getpgrp = 81,
-    setpgid = 82,
-    setitimer = 83,
-    /* 84  old wait */
-    swapon = 85,
-    getitimer = 86,
-    /* 87  old gethostname */
-    /* 88  old sethostname */
-    getdtablesize = 89,
-    dup2 = 90,
-    /* 91  old getdopt */
-    fcntl = 92,
-    select = 93,
-    /* 94  old setdopt */
-    fsync = 95,
-    setpriority = 96,
-    socket = 97,
-    connect = 98,
-    /* 99  old accept */
-    getpriority = 100,
-    /* 101  old send */
-    /* 102  old recv */
-    /* 103  old sigreturn */
-    bind = 104,
-    setsockopt = 105,
-    listen = 106,
-    /* 107  old vtimes */
-    /* 108  old sigvec */
-    /* 109  old sigblock */
-    /* 110  old sigsetmask */
-    sigsuspend = 111,
-    /* 112  old sigstack */
-    /* 113  old recvmsg */
-    /* 114  old sendmsg */
-    /* 115  old vtrace */
-    gettimeofday = 116,
-    getrusage = 117,
-    getsockopt = 118,
-    /* 119  old resuba */
-    readv = 120,
-    writev = 121,
-    settimeofday = 122,
-    fchown = 123,
-    fchmod = 124,
-    /* 125  old recvfrom */
-    setreuid = 126,
-    setregid = 127,
-    rename = 128,
-    /* 129  old truncate */
-    /* 130  old ftruncate */
-    flock = 131,
-    mkfifo = 132,
-    sendto = 133,
-    shutdown = 134,
-    socketpair = 135,
-    mkdir = 136,
-    rmdir = 137,
-    utimes = 138,
-    futimes = 139,
-    adjtime = 140,
-    /* 141  old getpeername */
-    gethostuuid = 142,
-    /* 143  old sethostid */
-    /* 144  old getrlimit */
-    /* 145  old setrlimit */
-    /* 146  old killpg */
-    setsid = 147,
-    /* 148  old setquota */
-    /* 149  old qquota */
-    /* 150  old getsockname */
-    getpgid = 151,
-    setprivexec = 152,
-    pread = 153,
-    pwrite = 154,
-    nfssvc = 155,
-    /* 156  old getdirentries */
-    statfs = 157,
-    fstatfs = 158,
-    unmount = 159,
-    /* 160  old async_daemon */
-    getfh = 161,
-    /* 162  old getdomainname */
-    /* 163  old setdomainname */
-    /* 164  */
-    quotactl = 165,
-    /* 166  old exportfs */
-    mount = 167,
-    /* 168  old ustat */
-    csops = 169,
-    csops_audittoken = 170,
-    /* 171  old wait3 */
-    /* 172  old rpause */
-    waitid = 173,
-    /* 174  old getdents */
-    /* 175  old gc_control */
-    /* 176  old add_profil */
-    kdebug_typefilter = 177,
-    kdebug_trace_string = 178,
-    kdebug_trace64 = 179,
-    kdebug_trace = 180,
-    setgid = 181,
-    setegid = 182,
-    seteuid = 183,
-    sigreturn = 184,
-    /* 185  old chud */
-    thread_selfcounts = 186,
-    fdatasync = 187,
-    stat = 188,
-    fstat = 189,
-    lstat = 190,
-    pathconf = 191,
-    fpathconf = 192,
-    /* 193  old getfsstat */
-    getrlimit = 194,
-    setrlimit = 195,
-    getdirentries = 196,
-    mmap = 197,
-    /* 198  old __syscall */
-    lseek = 199,
-    truncate = 200,
-    ftruncate = 201,
-    sysctl = 202,
-    mlock = 203,
-    munlock = 204,
-    undelete = 205,
-    /* 206  old ATsocket */
-    /* 207  old ATgetmsg */
-    /* 208  old ATputmsg */
-    /* 209  old ATsndreq */
-    /* 210  old ATsndrsp */
-    /* 211  old ATgetreq */
-    /* 212  old ATgetrsp */
-    /* 213  Reserved for AppleTalk */
-    /* 214  */
-    /* 215  */
-    open_dprotected_np = 216,
-    fsgetpath_ext = 217,
-    /* 218  old lstatv */
-    /* 219  old fstatv */
-    getattrlist = 220,
-    setattrlist = 221,
-    getdirentriesattr = 222,
-    exchangedata = 223,
-    /* 224  old checkuseraccess or fsgetpath */
-    searchfs = 225,
-    delete = 226,
-    copyfile = 227,
-    fgetattrlist = 228,
-    fsetattrlist = 229,
-    poll = 230,
-    /* 231  old watchevent */
-    /* 232  old waitevent */
-    /* 233  old modwatch */
-    getxattr = 234,
-    fgetxattr = 235,
-    setxattr = 236,
-    fsetxattr = 237,
-    removexattr = 238,
-    fremovexattr = 239,
-    listxattr = 240,
-    flistxattr = 241,
-    fsctl = 242,
-    initgroups = 243,
-    posix_spawn = 244,
-    ffsctl = 245,
-    /* 246  */
-    nfsclnt = 247,
-    fhopen = 248,
-    /* 249  */
-    minherit = 250,
-    semsys = 251,
-    msgsys = 252,
-    shmsys = 253,
-    semctl = 254,
-    semget = 255,
-    semop = 256,
-    /* 257  old semconfig */
-    msgctl = 258,
-    msgget = 259,
-    msgsnd = 260,
-    msgrcv = 261,
-    shmat = 262,
-    shmctl = 263,
-    shmdt = 264,
-    shmget = 265,
-    shm_open = 266,
-    shm_unlink = 267,
-    sem_open = 268,
-    sem_close = 269,
-    sem_unlink = 270,
-    sem_wait = 271,
-    sem_trywait = 272,
-    sem_post = 273,
-    sysctlbyname = 274,
-    /* 275  old sem_init */
-    /* 276  old sem_destroy */
-    open_extended = 277,
-    umask_extended = 278,
-    stat_extended = 279,
-    lstat_extended = 280,
-    fstat_extended = 281,
-    chmod_extended = 282,
-    fchmod_extended = 283,
-    access_extended = 284,
-    settid = 285,
-    gettid = 286,
-    setsgroups = 287,
-    getsgroups = 288,
-    setwgroups = 289,
-    getwgroups = 290,
-    mkfifo_extended = 291,
-    mkdir_extended = 292,
-    identitysvc = 293,
-    shared_region_check_np = 294,
-    /* 295  old shared_region_map_np */
-    vm_pressure_monitor = 296,
-    psynch_rw_longrdlock = 297,
-    psynch_rw_yieldwrlock = 298,
-    psynch_rw_downgrade = 299,
-    psynch_rw_upgrade = 300,
-    psynch_mutexwait = 301,
-    psynch_mutexdrop = 302,
-    psynch_cvbroad = 303,
-    psynch_cvsignal = 304,
-    psynch_cvwait = 305,
-    psynch_rw_rdlock = 306,
-    psynch_rw_wrlock = 307,
-    psynch_rw_unlock = 308,
-    psynch_rw_unlock2 = 309,
-    getsid = 310,
-    settid_with_pid = 311,
-    psynch_cvclrprepost = 312,
-    aio_fsync = 313,
-    aio_return = 314,
-    aio_suspend = 315,
-    aio_cancel = 316,
-    aio_error = 317,
-    aio_read = 318,
-    aio_write = 319,
-    lio_listio = 320,
-    /* 321  old __pthread_cond_wait */
-    iopolicysys = 322,
-    process_policy = 323,
-    mlockall = 324,
-    munlockall = 325,
-    /* 326  */
-    issetugid = 327,
-    __pthread_kill = 328,
-    __pthread_sigmask = 329,
-    __sigwait = 330,
-    __disable_threadsignal = 331,
-    __pthread_markcancel = 332,
-    __pthread_canceled = 333,
-    __semwait_signal = 334,
-    /* 335  old utrace */
-    proc_info = 336,
-    sendfile = 337,
-    stat64 = 338,
-    fstat64 = 339,
-    lstat64 = 340,
-    stat64_extended = 341,
-    lstat64_extended = 342,
-    fstat64_extended = 343,
-    getdirentries64 = 344,
-    statfs64 = 345,
-    fstatfs64 = 346,
-    getfsstat64 = 347,
-    __pthread_chdir = 348,
-    __pthread_fchdir = 349,
-    audit = 350,
-    auditon = 351,
-    /* 352  */
-    getauid = 353,
-    setauid = 354,
-    /* 355  old getaudit */
-    /* 356  old setaudit */
-    getaudit_addr = 357,
-    setaudit_addr = 358,
-    auditctl = 359,
-    bsdthread_create = 360,
-    bsdthread_terminate = 361,
-    kqueue = 362,
-    kevent = 363,
-    lchown = 364,
-    /* 365  old stack_snapshot */
-    bsdthread_register = 366,
-    workq_open = 367,
-    workq_kernreturn = 368,
-    kevent64 = 369,
-    __old_semwait_signal = 370,
-    __old_semwait_signal_nocancel = 371,
-    thread_selfid = 372,
-    ledger = 373,
-    kevent_qos = 374,
-    kevent_id = 375,
-    /* 376  */
-    /* 377  */
-    /* 378  */
-    /* 379  */
-    __mac_execve = 380,
-    __mac_syscall = 381,
-    __mac_get_file = 382,
-    __mac_set_file = 383,
-    __mac_get_link = 384,
-    __mac_set_link = 385,
-    __mac_get_proc = 386,
-    __mac_set_proc = 387,
-    __mac_get_fd = 388,
-    __mac_set_fd = 389,
-    __mac_get_pid = 390,
-    /* 391  */
-    /* 392  */
-    /* 393  */
-    pselect = 394,
-    pselect_nocancel = 395,
-    read_nocancel = 396,
-    write_nocancel = 397,
-    open_nocancel = 398,
-    close_nocancel = 399,
-    wait4_nocancel = 400,
-    recvmsg_nocancel = 401,
-    sendmsg_nocancel = 402,
-    recvfrom_nocancel = 403,
-    accept_nocancel = 404,
-    msync_nocancel = 405,
-    fcntl_nocancel = 406,
-    select_nocancel = 407,
-    fsync_nocancel = 408,
-    connect_nocancel = 409,
-    sigsuspend_nocancel = 410,
-    readv_nocancel = 411,
-    writev_nocancel = 412,
-    sendto_nocancel = 413,
-    pread_nocancel = 414,
-    pwrite_nocancel = 415,
-    waitid_nocancel = 416,
-    poll_nocancel = 417,
-    msgsnd_nocancel = 418,
-    msgrcv_nocancel = 419,
-    sem_wait_nocancel = 420,
-    aio_suspend_nocancel = 421,
-    __sigwait_nocancel = 422,
-    __semwait_signal_nocancel = 423,
-    __mac_mount = 424,
-    __mac_get_mount = 425,
-    __mac_getfsstat = 426,
-    fsgetpath = 427,
-    audit_session_self = 428,
-    audit_session_join = 429,
-    fileport_makeport = 430,
-    fileport_makefd = 431,
-    audit_session_port = 432,
-    pid_suspend = 433,
-    pid_resume = 434,
-    pid_hibernate = 435,
-    pid_shutdown_sockets = 436,
-    /* 437  old shared_region_slide_np */
-    shared_region_map_and_slide_np = 438,
-    kas_info = 439,
-    memorystatus_control = 440,
-    guarded_open_np = 441,
-    guarded_close_np = 442,
-    guarded_kqueue_np = 443,
-    change_fdguard_np = 444,
-    usrctl = 445,
-    proc_rlimit_control = 446,
-    connectx = 447,
-    disconnectx = 448,
-    peeloff = 449,
-    socket_delegate = 450,
-    telemetry = 451,
-    proc_uuid_policy = 452,
-    memorystatus_get_level = 453,
-    system_override = 454,
-    vfs_purge = 455,
-    sfi_ctl = 456,
-    sfi_pidctl = 457,
-    coalition = 458,
-    coalition_info = 459,
-    necp_match_policy = 460,
-    getattrlistbulk = 461,
-    clonefileat = 462,
-    openat = 463,
-    openat_nocancel = 464,
-    renameat = 465,
-    faccessat = 466,
-    fchmodat = 467,
-    fchownat = 468,
-    fstatat = 469,
-    fstatat64 = 470,
-    linkat = 471,
-    unlinkat = 472,
-    readlinkat = 473,
-    symlinkat = 474,
-    mkdirat = 475,
-    getattrlistat = 476,
-    proc_trace_log = 477,
-    bsdthread_ctl = 478,
-    openbyid_np = 479,
-    recvmsg_x = 480,
-    sendmsg_x = 481,
-    thread_selfusage = 482,
-    csrctl = 483,
-    guarded_open_dprotected_np = 484,
-    guarded_write_np = 485,
-    guarded_pwrite_np = 486,
-    guarded_writev_np = 487,
-    renameatx_np = 488,
-    mremap_encrypted = 489,
-    netagent_trigger = 490,
-    stack_snapshot_with_config = 491,
-    microstackshot = 492,
-    grab_pgo_data = 493,
-    persona = 494,
-    /* 495  */
-    mach_eventlink_signal = 496,
-    mach_eventlink_wait_until = 497,
-    mach_eventlink_signal_wait_until = 498,
-    work_interval_ctl = 499,
-    getentropy = 500,
-    necp_open = 501,
-    necp_client_action = 502,
-    nexus_open = 503,       // for those who are intressted http://newosxbook.com/bonus/vol1ch16.html
-    nexus_register = 504,  
-    nexus_deregister = 505,
-    nexus_create = 506,
-    nexus_destroy = 507,
-    nexus_get_opt = 508,
-    nexus_set_opt = 509,
-    channel_open = 510,
-    channel_get_info = 511,
-    channel_sync = 512,
-    channel_get_opt = 513,
-    channel_set_opt = 514,
-    ulock_wait = 515,
-    ulock_wake = 516,
-    fclonefileat = 517,
-    fs_snapshot = 518,
-    register_uexc_handler = 519,
-    terminate_with_payload = 520,
-    abort_with_payload = 521,
-    necp_session_open = 522,
-    necp_session_action = 523,
-    setattrlistat = 524,
-    net_qos_guideline = 525,
-    fmount = 526,
-    ntp_adjtime = 527,
-    ntp_gettime = 528,
-    os_fault_with_payload = 529,
-    kqueue_workloop_ctl = 530,
-    mach_bridge_remote_time = 531, 
-    coalition_ledger = 532,
-    log_data = 533,
-    memorystatus_available_memory = 534,
-    objc_bp_assist_cfg_np = 535,
-    shared_region_map_and_slide_2_np = 536,
-    pivot_root = 537,
-    task_inspect_for_pid = 538,
-    task_read_for_pid = 539,
-    preadv = 540,
-    pwritev = 541,
-    preadv_nocancel = 542,
-    pwritev_nocancel = 543,
-    ulock_wait2 = 544,
-    proc_info_extended_id = 545,
-    tracker_action = 546,
-    debug_syscall_reject = 547,
-    MAXSYSCALL = 548,
-    /* invalid = 63, */
+	/* 0 syscall */
+	exit = 1,
+	fork = 2,
+	read = 3,
+	write = 4,
+	open = 5,
+	close = 6,
+	wait4 = 7,
+	/* 8  old creat */
+	link = 9,
+	unlink = 10,
+	/* 11  old execv */
+	chdir = 12,
+	fchdir = 13,
+	mknod = 14,
+	chmod = 15,
+	chown = 16,
+	/* 17  old break */
+	getfsstat = 18,
+	/* 19  old lseek */
+	getpid = 20,
+	/* 21  old mount */
+	/* 22  old umount */
+	setuid = 23,
+	getuid = 24,
+	geteuid = 25,
+	ptrace = 26,
+	recvmsg = 27,
+	sendmsg = 28,
+	recvfrom = 29,
+	accept = 30,
+	getpeername = 31,
+	getsockname = 32,
+	access = 33,
+	chflags = 34,
+	fchflags = 35,
+	sync = 36,
+	kill = 37,
+	/* 38  old stat */
+	getppid = 39,
+	/* 40  old lstat */
+	dup = 41,
+	pipe = 42,
+	getegid = 43,
+	/* 44  old profil */
+	/* 45  old ktrace */
+	sigaction = 46,
+	getgid = 47,
+	sigprocmask = 48,
+	getlogin = 49,
+	setlogin = 50,
+	acct = 51,
+	sigpending = 52,
+	sigaltstack = 53,
+	ioctl = 54,
+	reboot = 55,
+	revoke = 56,
+	symlink = 57,
+	readlink = 58,
+	execve = 59,
+	umask = 60,
+	chroot = 61,
+	/* 62  old fstat */
+	/* 63  used internally and reserved */
+	/* getpagesize = 64, invalid */
+	msync = 65,
+	vfork = 66,
+	/* 67  old vread */
+	/* 68  old vwrite */
+	/* 69  old sbrk */
+	/* 70  old sstk */
+	/* 71  old mmap */
+	/* 72  old vadvise */
+	munmap = 73,
+	mprotect = 74,
+	madvise = 75,
+	/* 76  old vhangup */
+	/* 77  old vlimit */
+	mincore = 78,
+	getgroups = 79,
+	setgroups = 80,
+	getpgrp = 81,
+	setpgid = 82,
+	setitimer = 83,
+	/* 84  old wait */
+	swapon = 85,
+	getitimer = 86,
+	/* 87  old gethostname */
+	/* 88  old sethostname */
+	getdtablesize = 89,
+	dup2 = 90,
+	/* 91  old getdopt */
+	fcntl = 92,
+	select = 93,
+	/* 94  old setdopt */
+	fsync = 95,
+	setpriority = 96,
+	socket = 97,
+	connect = 98,
+	/* 99  old accept */
+	getpriority = 100,
+	/* 101  old send */
+	/* 102  old recv */
+	/* 103  old sigreturn */
+	bind = 104,
+	setsockopt = 105,
+	listen = 106,
+	/* 107  old vtimes */
+	/* 108  old sigvec */
+	/* 109  old sigblock */
+	/* 110  old sigsetmask */
+	sigsuspend = 111,
+	/* 112  old sigstack */
+	/* 113  old recvmsg */
+	/* 114  old sendmsg */
+	/* 115  old vtrace */
+	gettimeofday = 116,
+	getrusage = 117,
+	getsockopt = 118,
+	/* 119  old resuba */
+	readv = 120,
+	writev = 121,
+	settimeofday = 122,
+	fchown = 123,
+	fchmod = 124,
+	/* 125  old recvfrom */
+	setreuid = 126,
+	setregid = 127,
+	rename = 128,
+	/* 129  old truncate */
+	/* 130  old ftruncate */
+	flock = 131,
+	mkfifo = 132,
+	sendto = 133,
+	shutdown = 134,
+	socketpair = 135,
+	mkdir = 136,
+	rmdir = 137,
+	utimes = 138,
+	futimes = 139,
+	adjtime = 140,
+	/* 141  old getpeername */
+	gethostuuid = 142,
+	/* 143  old sethostid */
+	/* 144  old getrlimit */
+	/* 145  old setrlimit */
+	/* 146  old killpg */
+	setsid = 147,
+	/* 148  old setquota */
+	/* 149  old qquota */
+	/* 150  old getsockname */
+	getpgid = 151,
+	setprivexec = 152,
+	pread = 153,
+	pwrite = 154,
+	nfssvc = 155,
+	/* 156  old getdirentries */
+	statfs = 157,
+	fstatfs = 158,
+	unmount = 159,
+	/* 160  old async_daemon */
+	getfh = 161,
+	/* 162  old getdomainname */
+	/* 163  old setdomainname */
+	/* 164  */
+	quotactl = 165,
+	/* 166  old exportfs */
+	mount = 167,
+	/* 168  old ustat */
+	csops = 169,
+	csops_audittoken = 170,
+	/* 171  old wait3 */
+	/* 172  old rpause */
+	waitid = 173,
+	/* 174  old getdents */
+	/* 175  old gc_control */
+	/* 176  old add_profil */
+	kdebug_typefilter = 177,
+	kdebug_trace_string = 178,
+	kdebug_trace64 = 179,
+	kdebug_trace = 180,
+	setgid = 181,
+	setegid = 182,
+	seteuid = 183,
+	sigreturn = 184,
+	/* 185  old chud */
+	thread_selfcounts = 186,
+	fdatasync = 187,
+	stat = 188,
+	fstat = 189,
+	lstat = 190,
+	pathconf = 191,
+	fpathconf = 192,
+	/* 193  old getfsstat */
+	getrlimit = 194,
+	setrlimit = 195,
+	getdirentries = 196,
+	mmap = 197,
+	/* 198  old __syscall */
+	lseek = 199,
+	truncate = 200,
+	ftruncate = 201,
+	sysctl = 202,
+	mlock = 203,
+	munlock = 204,
+	undelete = 205,
+	/* 206  old ATsocket */
+	/* 207  old ATgetmsg */
+	/* 208  old ATputmsg */
+	/* 209  old ATsndreq */
+	/* 210  old ATsndrsp */
+	/* 211  old ATgetreq */
+	/* 212  old ATgetrsp */
+	/* 213  Reserved for AppleTalk */
+	/* 214  */
+	/* 215  */
+	open_dprotected_np = 216,
+	fsgetpath_ext = 217,
+	/* 218  old lstatv */
+	/* 219  old fstatv */
+	getattrlist = 220,
+	setattrlist = 221,
+	getdirentriesattr = 222,
+	exchangedata = 223,
+	/* 224  old checkuseraccess or fsgetpath */
+	searchfs = 225,
+	delete = 226,
+	copyfile = 227,
+	fgetattrlist = 228,
+	fsetattrlist = 229,
+	poll = 230,
+	/* 231  old watchevent */
+	/* 232  old waitevent */
+	/* 233  old modwatch */
+	getxattr = 234,
+	fgetxattr = 235,
+	setxattr = 236,
+	fsetxattr = 237,
+	removexattr = 238,
+	fremovexattr = 239,
+	listxattr = 240,
+	flistxattr = 241,
+	fsctl = 242,
+	initgroups = 243,
+	posix_spawn = 244,
+	ffsctl = 245,
+	/* 246  */
+	nfsclnt = 247,
+	fhopen = 248,
+	/* 249  */
+	minherit = 250,
+	semsys = 251,
+	msgsys = 252,
+	shmsys = 253,
+	semctl = 254,
+	semget = 255,
+	semop = 256,
+	/* 257  old semconfig */
+	msgctl = 258,
+	msgget = 259,
+	msgsnd = 260,
+	msgrcv = 261,
+	shmat = 262,
+	shmctl = 263,
+	shmdt = 264,
+	shmget = 265,
+	shm_open = 266,
+	shm_unlink = 267,
+	sem_open = 268,
+	sem_close = 269,
+	sem_unlink = 270,
+	sem_wait = 271,
+	sem_trywait = 272,
+	sem_post = 273,
+	sysctlbyname = 274,
+	/* 275  old sem_init */
+	/* 276  old sem_destroy */
+	open_extended = 277,
+	umask_extended = 278,
+	stat_extended = 279,
+	lstat_extended = 280,
+	fstat_extended = 281,
+	chmod_extended = 282,
+	fchmod_extended = 283,
+	access_extended = 284,
+	settid = 285,
+	gettid = 286,
+	setsgroups = 287,
+	getsgroups = 288,
+	setwgroups = 289,
+	getwgroups = 290,
+	mkfifo_extended = 291,
+	mkdir_extended = 292,
+	identitysvc = 293,
+	shared_region_check_np = 294,
+	/* 295  old shared_region_map_np */
+	vm_pressure_monitor = 296,
+	psynch_rw_longrdlock = 297,
+	psynch_rw_yieldwrlock = 298,
+	psynch_rw_downgrade = 299,
+	psynch_rw_upgrade = 300,
+	psynch_mutexwait = 301,
+	psynch_mutexdrop = 302,
+	psynch_cvbroad = 303,
+	psynch_cvsignal = 304,
+	psynch_cvwait = 305,
+	psynch_rw_rdlock = 306,
+	psynch_rw_wrlock = 307,
+	psynch_rw_unlock = 308,
+	psynch_rw_unlock2 = 309,
+	getsid = 310,
+	settid_with_pid = 311,
+	psynch_cvclrprepost = 312,
+	aio_fsync = 313,
+	aio_return = 314,
+	aio_suspend = 315,
+	aio_cancel = 316,
+	aio_error = 317,
+	aio_read = 318,
+	aio_write = 319,
+	lio_listio = 320,
+	/* 321  old __pthread_cond_wait */
+	iopolicysys = 322,
+	process_policy = 323,
+	mlockall = 324,
+	munlockall = 325,
+	/* 326  */
+	issetugid = 327,
+	__pthread_kill = 328,
+	__pthread_sigmask = 329,
+	__sigwait = 330,
+	__disable_threadsignal = 331,
+	__pthread_markcancel = 332,
+	__pthread_canceled = 333,
+	__semwait_signal = 334,
+	/* 335  old utrace */
+	proc_info = 336,
+	sendfile = 337,
+	stat64 = 338,
+	fstat64 = 339,
+	lstat64 = 340,
+	stat64_extended = 341,
+	lstat64_extended = 342,
+	fstat64_extended = 343,
+	getdirentries64 = 344,
+	statfs64 = 345,
+	fstatfs64 = 346,
+	getfsstat64 = 347,
+	__pthread_chdir = 348,
+	__pthread_fchdir = 349,
+	audit = 350,
+	auditon = 351,
+	/* 352  */
+	getauid = 353,
+	setauid = 354,
+	/* 355  old getaudit */
+	/* 356  old setaudit */
+	getaudit_addr = 357,
+	setaudit_addr = 358,
+	auditctl = 359,
+	bsdthread_create = 360,
+	bsdthread_terminate = 361,
+	kqueue = 362,
+	kevent = 363,
+	lchown = 364,
+	/* 365  old stack_snapshot */
+	bsdthread_register = 366,
+	workq_open = 367,
+	workq_kernreturn = 368,
+	kevent64 = 369,
+	__old_semwait_signal = 370,
+	__old_semwait_signal_nocancel = 371,
+	thread_selfid = 372,
+	ledger = 373,
+	kevent_qos = 374,
+	kevent_id = 375,
+	/* 376  */
+	/* 377  */
+	/* 378  */
+	/* 379  */
+	__mac_execve = 380,
+	__mac_syscall = 381,
+	__mac_get_file = 382,
+	__mac_set_file = 383,
+	__mac_get_link = 384,
+	__mac_set_link = 385,
+	__mac_get_proc = 386,
+	__mac_set_proc = 387,
+	__mac_get_fd = 388,
+	__mac_set_fd = 389,
+	__mac_get_pid = 390,
+	/* 391  */
+	/* 392  */
+	/* 393  */
+	pselect = 394,
+	pselect_nocancel = 395,
+	read_nocancel = 396,
+	write_nocancel = 397,
+	open_nocancel = 398,
+	close_nocancel = 399,
+	wait4_nocancel = 400,
+	recvmsg_nocancel = 401,
+	sendmsg_nocancel = 402,
+	recvfrom_nocancel = 403,
+	accept_nocancel = 404,
+	msync_nocancel = 405,
+	fcntl_nocancel = 406,
+	select_nocancel = 407,
+	fsync_nocancel = 408,
+	connect_nocancel = 409,
+	sigsuspend_nocancel = 410,
+	readv_nocancel = 411,
+	writev_nocancel = 412,
+	sendto_nocancel = 413,
+	pread_nocancel = 414,
+	pwrite_nocancel = 415,
+	waitid_nocancel = 416,
+	poll_nocancel = 417,
+	msgsnd_nocancel = 418,
+	msgrcv_nocancel = 419,
+	sem_wait_nocancel = 420,
+	aio_suspend_nocancel = 421,
+	__sigwait_nocancel = 422,
+	__semwait_signal_nocancel = 423,
+	__mac_mount = 424,
+	__mac_get_mount = 425,
+	__mac_getfsstat = 426,
+	fsgetpath = 427,
+	audit_session_self = 428,
+	audit_session_join = 429,
+	fileport_makeport = 430,
+	fileport_makefd = 431,
+	audit_session_port = 432,
+	pid_suspend = 433,
+	pid_resume = 434,
+	pid_hibernate = 435,
+	pid_shutdown_sockets = 436,
+	/* 437  old shared_region_slide_np */
+	shared_region_map_and_slide_np = 438,
+	kas_info = 439,
+	memorystatus_control = 440,
+	guarded_open_np = 441,
+	guarded_close_np = 442,
+	guarded_kqueue_np = 443,
+	change_fdguard_np = 444,
+	usrctl = 445,
+	proc_rlimit_control = 446,
+	connectx = 447,
+	disconnectx = 448,
+	peeloff = 449,
+	socket_delegate = 450,
+	telemetry = 451,
+	proc_uuid_policy = 452,
+	memorystatus_get_level = 453,
+	system_override = 454,
+	vfs_purge = 455,
+	sfi_ctl = 456,
+	sfi_pidctl = 457,
+	coalition = 458,
+	coalition_info = 459,
+	necp_match_policy = 460,
+	getattrlistbulk = 461,
+	clonefileat = 462,
+	openat = 463,
+	openat_nocancel = 464,
+	renameat = 465,
+	faccessat = 466,
+	fchmodat = 467,
+	fchownat = 468,
+	fstatat = 469,
+	fstatat64 = 470,
+	linkat = 471,
+	unlinkat = 472,
+	readlinkat = 473,
+	symlinkat = 474,
+	mkdirat = 475,
+	getattrlistat = 476,
+	proc_trace_log = 477,
+	bsdthread_ctl = 478,
+	openbyid_np = 479,
+	recvmsg_x = 480,
+	sendmsg_x = 481,
+	thread_selfusage = 482,
+	csrctl = 483,
+	guarded_open_dprotected_np = 484,
+	guarded_write_np = 485,
+	guarded_pwrite_np = 486,
+	guarded_writev_np = 487,
+	renameatx_np = 488,
+	mremap_encrypted = 489,
+	netagent_trigger = 490,
+	stack_snapshot_with_config = 491,
+	microstackshot = 492,
+	grab_pgo_data = 493,
+	persona = 494,
+	/* 495  */
+	mach_eventlink_signal = 496,
+	mach_eventlink_wait_until = 497,
+	mach_eventlink_signal_wait_until = 498,
+	work_interval_ctl = 499,
+	getentropy = 500,
+	necp_open = 501,
+	necp_client_action = 502,
+	nexus_open = 503,       // for those who are intressted http://newosxbook.com/bonus/vol1ch16.html
+	nexus_register = 504,
+	nexus_deregister = 505,
+	nexus_create = 506,
+	nexus_destroy = 507,
+	nexus_get_opt = 508,
+	nexus_set_opt = 509,
+	channel_open = 510,
+	channel_get_info = 511,
+	channel_sync = 512,
+	channel_get_opt = 513,
+	channel_set_opt = 514,
+	ulock_wait = 515,
+	ulock_wake = 516,
+	fclonefileat = 517,
+	fs_snapshot = 518,
+	register_uexc_handler = 519,
+	terminate_with_payload = 520,
+	abort_with_payload = 521,
+	necp_session_open = 522,
+	necp_session_action = 523,
+	setattrlistat = 524,
+	net_qos_guideline = 525,
+	fmount = 526,
+	ntp_adjtime = 527,
+	ntp_gettime = 528,
+	os_fault_with_payload = 529,
+	kqueue_workloop_ctl = 530,
+	mach_bridge_remote_time = 531,
+	coalition_ledger = 532,
+	log_data = 533,
+	memorystatus_available_memory = 534,
+	objc_bp_assist_cfg_np = 535,
+	shared_region_map_and_slide_2_np = 536,
+	pivot_root = 537,
+	task_inspect_for_pid = 538,
+	task_read_for_pid = 539,
+	preadv = 540,
+	pwritev = 541,
+	preadv_nocancel = 542,
+	pwritev_nocancel = 543,
+	ulock_wait2 = 544,
+	proc_info_extended_id = 545,
+	tracker_action = 546,
+	debug_syscall_reject = 547,
+	MAXSYSCALL = 548,
+	/* invalid = 63, */
 }
 }

+ 1 - 1
core/sys/linux/wrappers.odin

@@ -48,7 +48,7 @@ WCOREDUMP :: #force_inline proc "contextless" (s: u32) -> bool {
 	return 1 << ((cast(uint)(sig) - 1) % (8*size_of(uint)))
 	return 1 << ((cast(uint)(sig) - 1) % (8*size_of(uint)))
 }
 }
 @private _sigword :: proc "contextless" (sig: Signal) -> (uint) {
 @private _sigword :: proc "contextless" (sig: Signal) -> (uint) {
-  return (cast(uint)sig - 1) / (8*size_of(uint))
+	return (cast(uint)sig - 1) / (8*size_of(uint))
 }
 }
 
 
 // TODO: sigaddset etc
 // TODO: sigaddset etc

+ 1 - 1
core/unicode/letter.odin

@@ -242,7 +242,7 @@ is_enclosing_mark :: proc(r: rune) -> bool {
 	     0x20DD ..= 0x20E0,
 	     0x20DD ..= 0x20E0,
 	     0x20E2 ..= 0x20E4,
 	     0x20E2 ..= 0x20E4,
 	     0xA670 ..= 0xA672:
 	     0xA670 ..= 0xA672:
-	     return true
+		return true
 	}
 	}
 
 
 	return false
 	return false

+ 1 - 1
examples/demo/demo.odin

@@ -2275,7 +2275,7 @@ arbitrary_precision_mathematics :: proc() {
 		}
 		}
 		fmt.printf(as)
 		fmt.printf(as)
 		if print_extra_info {
 		if print_extra_info {
-		 	fmt.printf(" (base: %v, bits: %v, digits: %v)", base, cb, a.used)
+			fmt.printf(" (base: %v, bits: %v, digits: %v)", base, cb, a.used)
 		}
 		}
 		if newline {
 		if newline {
 			fmt.println()
 			fmt.println()

+ 9 - 9
vendor/OpenGL/wrappers.odin

@@ -781,17 +781,17 @@ when !GL_DEBUG {
 			{
 			{
 				// add input arguments
 				// add input arguments
 				for arg, arg_index in args[num_ret:] {
 				for arg, arg_index in args[num_ret:] {
-				if arg_index > 0 { fmt.printf(", ") }
+					if arg_index > 0 { fmt.printf(", ") }
 
 
-				if v, ok := arg.(u32); ok { // TODO: Assumes all u32 are GLenum (they're not, GLbitfield and GLuint are also mapped to u32), fix later by better typing
-					if err == .INVALID_ENUM {
-						fmt.printf("INVALID_ENUM=%d", v)
+					if v, ok := arg.(u32); ok { // TODO: Assumes all u32 are GLenum (they're not, GLbitfield and GLuint are also mapped to u32), fix later by better typing
+						if err == .INVALID_ENUM {
+							fmt.printf("INVALID_ENUM=%d", v)
+						} else {
+							fmt.printf("GL_%v=%d", GL_Enum(v), v)
+						}
 					} else {
 					} else {
-						fmt.printf("GL_%v=%d", GL_Enum(v), v)
+						fmt.printf("%v", arg)
 					}
 					}
-				} else {
-					fmt.printf("%v", arg)
-				}
 				}
 				}
 
 
 				// add return arguments
 				// add return arguments
@@ -810,7 +810,7 @@ when !GL_DEBUG {
 			}
 			}
 
 
 			// add location
 			// add location
-		    fmt.printf("   in:   %s(%d:%d)\n", from_loc.file_path, from_loc.line, from_loc.column)
+			fmt.printf("   in:   %s(%d:%d)\n", from_loc.file_path, from_loc.line, from_loc.column)
 		}
 		}
 	}
 	}
 
 

+ 3 - 3
vendor/commonmark/cmark.odin

@@ -494,15 +494,15 @@ free_cstring :: proc "c" (str: cstring) {
 	free_rawptr(rawptr(str))
 	free_rawptr(rawptr(str))
 }
 }
 free_string :: proc "c" (s: string) {
 free_string :: proc "c" (s: string) {
-    free_rawptr(raw_data(s))
+	free_rawptr(raw_data(s))
 }
 }
 free :: proc{free_rawptr, free_cstring}
 free :: proc{free_rawptr, free_cstring}
 
 
 // Wrap CMark allocator as Odin allocator
 // Wrap CMark allocator as Odin allocator
 @(private)
 @(private)
 cmark_allocator_proc :: proc(allocator_data: rawptr, mode: runtime.Allocator_Mode,
 cmark_allocator_proc :: proc(allocator_data: rawptr, mode: runtime.Allocator_Mode,
-                           size, alignment: int,
-                           old_memory: rawptr, old_size: int, loc := #caller_location) -> (res: []byte, err: runtime.Allocator_Error) {
+                             size, alignment: int,
+                             old_memory: rawptr, old_size: int, loc := #caller_location) -> (res: []byte, err: runtime.Allocator_Error) {
 
 
 	cmark_alloc := cast(^Allocator)allocator_data
 	cmark_alloc := cast(^Allocator)allocator_data
 	switch mode {
 	switch mode {

+ 2 - 2
vendor/sdl2/sdl2.odin

@@ -235,8 +235,8 @@ foreign lib {
 // quit
 // quit
 
 
 QuitRequested :: #force_inline proc "c" () -> bool {
 QuitRequested :: #force_inline proc "c" () -> bool {
-        PumpEvents()
-        return bool(PeepEvents(nil, 0, .PEEKEVENT, .QUIT, .QUIT) > 0)
+	PumpEvents()
+	return bool(PeepEvents(nil, 0, .PEEKEVENT, .QUIT, .QUIT) > 0)
 }
 }
 
 
 
 

+ 1 - 1
vendor/vulkan/_gen/create_vulkan_odin_wrapper.py

@@ -798,7 +798,7 @@ API_VERSION_1_2 :: (1<<22) | (2<<12) | (0)
 API_VERSION_1_3 :: (1<<22) | (3<<12) | (0)
 API_VERSION_1_3 :: (1<<22) | (3<<12) | (0)
 
 
 MAKE_VERSION :: proc(major, minor, patch: u32) -> u32 {
 MAKE_VERSION :: proc(major, minor, patch: u32) -> u32 {
-    return (major<<22) | (minor<<12) | (patch)
+\treturn (major<<22) | (minor<<12) | (patch)
 }
 }
 
 
 // Base types
 // Base types

+ 1 - 1
vendor/vulkan/core.odin

@@ -8,7 +8,7 @@ API_VERSION_1_2 :: (1<<22) | (2<<12) | (0)
 API_VERSION_1_3 :: (1<<22) | (3<<12) | (0)
 API_VERSION_1_3 :: (1<<22) | (3<<12) | (0)
 
 
 MAKE_VERSION :: proc(major, minor, patch: u32) -> u32 {
 MAKE_VERSION :: proc(major, minor, patch: u32) -> u32 {
-    return (major<<22) | (minor<<12) | (patch)
+	return (major<<22) | (minor<<12) | (patch)
 }
 }
 
 
 // Base types
 // Base types