aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-12-18 22:23:34 +0000
committerGinger Bill <bill@gingerbill.org>2016-12-18 22:23:34 +0000
commit4c10fbdcd46c7ba425301fcb3ba46f9cc226bed3 (patch)
treea563c4cff644db77fc9934120ee127c0a06c818e /core
parente370337f97f80b99ff01031b7006e06d6433d475 (diff)
Change record field syntax
Diffstat (limited to 'core')
-rw-r--r--core/_preload.odin110
-rw-r--r--core/mem.odin12
-rw-r--r--core/os_windows.odin8
-rw-r--r--core/sync.odin10
-rw-r--r--core/sys/windows.odin90
-rw-r--r--core/utf8.odin2
6 files changed, 116 insertions, 116 deletions
diff --git a/core/_preload.odin b/core/_preload.odin
index 995b1d72a..35d9a4a1c 100644
--- a/core/_preload.odin
+++ b/core/_preload.odin
@@ -13,67 +13,67 @@
// IMPORTANT NOTE(bill): Do not change the order of any of this data
// The compiler relies upon this _exact_ order
type Type_Info_Member struct #ordered {
- name: string; // can be empty if tuple
- type_info: ^Type_Info;
- offset: int; // offsets are not used in tuples
-};
+ name string; // can be empty if tuple
+ type_info ^Type_Info;
+ offset int; // offsets are not used in tuples
+}
type Type_Info_Record struct #ordered {
- fields: []Type_Info_Member;
- size: int; // in bytes
- align: int; // in bytes
- packed: bool;
- ordered: bool;
-};
+ fields []Type_Info_Member;
+ size int; // in bytes
+ align int; // in bytes
+ packed bool;
+ ordered bool;
+}
type Type_Info union {
- Named: struct #ordered {
- name: string;
- base: ^Type_Info; // This will _not_ be a Type_Info.Named
+ Named struct #ordered {
+ name string;
+ base ^Type_Info; // This will _not_ be a Type_Info.Named
};
- Integer: struct #ordered {
- size: int; // in bytes
- signed: bool;
+ Integer struct #ordered {
+ size int; // in bytes
+ signed bool;
};
- Float: struct #ordered {
- size: int; // in bytes
+ Float struct #ordered {
+ size int; // in bytes
};
- Any: struct #ordered {};
- String: struct #ordered {};
- Boolean: struct #ordered {};
- Pointer: struct #ordered {
- elem: ^Type_Info; // nil -> rawptr
+ Any struct #ordered {};
+ String struct #ordered {};
+ Boolean struct #ordered {};
+ Pointer struct #ordered {
+ elem ^Type_Info; // nil -> rawptr
};
- Maybe: struct #ordered {
- elem: ^Type_Info;
+ Maybe struct #ordered {
+ elem ^Type_Info;
};
- Procedure: struct #ordered {
- params: ^Type_Info; // Type_Info.Tuple
- results: ^Type_Info; // Type_Info.Tuple
- variadic: bool;
+ Procedure struct #ordered {
+ params ^Type_Info; // Type_Info.Tuple
+ results ^Type_Info; // Type_Info.Tuple
+ variadic bool;
};
- Array: struct #ordered {
- elem: ^Type_Info;
- elem_size: int;
- count: int;
+ Array struct #ordered {
+ elem ^Type_Info;
+ elem_size int;
+ count int;
};
- Slice: struct #ordered {
- elem: ^Type_Info;
- elem_size: int;
+ Slice struct #ordered {
+ elem ^Type_Info;
+ elem_size int;
};
- Vector: struct #ordered {
- elem: ^Type_Info;
- elem_size: int;
- count: int;
- align: int;
+ Vector struct #ordered {
+ elem ^Type_Info;
+ elem_size int;
+ count int;
+ align int;
};
- Tuple: Type_Info_Record;
- Struct: Type_Info_Record;
- Union: Type_Info_Record;
- Raw_Union: Type_Info_Record;
- Enum: struct #ordered {
- base: ^Type_Info;
- values: []i64;
- names: []string;
+ Tuple Type_Info_Record;
+ Struct Type_Info_Record;
+ Union Type_Info_Record;
+ Raw_Union Type_Info_Record;
+ Enum struct #ordered {
+ base ^Type_Info;
+ values []i64;
+ names []string;
};
};
@@ -126,18 +126,18 @@ type Allocator_Proc proc(allocator_data rawptr, mode Allocator_Mode,
type Allocator struct #ordered {
- procedure: Allocator_Proc;
- data: rawptr;
+ procedure Allocator_Proc;
+ data rawptr;
}
type Context struct #ordered {
- thread_id: int;
+ thread_id int;
- allocator: Allocator;
+ allocator Allocator;
- user_data: rawptr;
- user_index: int;
+ user_data rawptr;
+ user_index int;
}
#thread_local var __context Context;
diff --git a/core/mem.odin b/core/mem.odin
index ecd626750..9c37018ce 100644
--- a/core/mem.odin
+++ b/core/mem.odin
@@ -90,7 +90,7 @@ proc align_forward(ptr rawptr, align int) -> rawptr {
type Allocation_Header struct {
- size: int;
+ size int;
}
proc allocation_header_fill(header ^Allocation_Header, data rawptr, size int) {
header.size = size;
@@ -115,14 +115,14 @@ proc allocation_header(data rawptr) -> ^Allocation_Header {
// Custom allocators
type Arena struct {
- backing: Allocator;
- memory: []byte;
- temp_count: int;
+ backing Allocator;
+ memory []byte;
+ temp_count int;
}
type Arena_Temp_Memory struct {
- arena: ^Arena;
- original_count: int;
+ arena ^Arena;
+ original_count int;
}
diff --git a/core/os_windows.odin b/core/os_windows.odin
index dbf20ed5d..553b8bd49 100644
--- a/core/os_windows.odin
+++ b/core/os_windows.odin
@@ -4,13 +4,13 @@
type File_Time u64;
type File_Handle raw_union {
- p: rawptr;
- i: int;
+ p rawptr;
+ i int;
}
type File struct {
- handle: File_Handle;
- last_write_time: File_Time;
+ handle File_Handle;
+ last_write_time File_Time;
}
proc open(name string) -> (File, bool) {
diff --git a/core/sync.odin b/core/sync.odin
index 9bcede9a1..9b317e56d 100644
--- a/core/sync.odin
+++ b/core/sync.odin
@@ -2,14 +2,14 @@
#import "atomic.odin";
type Semaphore struct {
- handle: win32.HANDLE;
+ handle win32.HANDLE;
}
type Mutex struct {
- semaphore: Semaphore;
- counter: i32;
- owner: i32;
- recursion: i32;
+ semaphore Semaphore;
+ counter i32;
+ owner i32;
+ recursion i32;
}
diff --git a/core/sys/windows.odin b/core/sys/windows.odin
index 782494cbb..5ddbb5cab 100644
--- a/core/sys/windows.odin
+++ b/core/sys/windows.odin
@@ -51,62 +51,62 @@ const SM_CYSCREEN = 1;
const SW_SHOW = 5;
type POINT struct #ordered {
- x, y: i32;
+ x, y i32;
}
type WNDCLASSEXA struct #ordered {
- size, style: u32;
- wnd_proc: WNDPROC;
- cls_extra, wnd_extra: i32;
- instance: HINSTANCE;
- icon: HICON;
- cursor: HCURSOR;
- background: HBRUSH;
- menu_name, class_name: ^u8;
- sm: HICON;
+ size, style u32;
+ wnd_proc WNDPROC;
+ cls_extra, wnd_extra i32;
+ instance HINSTANCE;
+ icon HICON;
+ cursor HCURSOR;
+ background HBRUSH;
+ menu_name, class_name ^u8;
+ sm HICON;
}
type MSG struct #ordered {
- hwnd: HWND;
- message: u32;
- wparam: WPARAM;
- lparam: LPARAM;
- time: u32;
- pt: POINT;
+ hwnd HWND;
+ message u32;
+ wparam WPARAM;
+ lparam LPARAM;
+ time u32;
+ pt POINT;
}
type RECT struct #ordered {
- left: i32;
- top: i32;
- right: i32;
- bottom: i32;
+ left i32;
+ top i32;
+ right i32;
+ bottom i32;
}
type FILETIME struct #ordered {
- low_date_time, high_date_time: u32;
+ low_date_time, high_date_time u32;
}
type BY_HANDLE_FILE_INFORMATION struct #ordered {
- file_attributes: u32;
+ file_attributes u32;
creation_time,
last_access_time,
- last_write_time: FILETIME;
+ last_write_time FILETIME;
volume_serial_number,
file_size_high,
file_size_low,
number_of_links,
file_index_high,
- file_index_low: u32;
+ file_index_low u32;
}
type WIN32_FILE_ATTRIBUTE_DATA struct #ordered {
- file_attributes: u32;
+ file_attributes u32;
creation_time,
last_access_time,
- last_write_time: FILETIME;
+ last_write_time FILETIME;
file_size_high,
- file_size_low: u32;
+ file_size_low u32;
}
type GET_FILEEX_INFO_LEVELS i32;
@@ -209,9 +209,9 @@ const HEAP_ZERO_MEMORY = 0x00000008;
// Synchronization
type SECURITY_ATTRIBUTES struct #ordered {
- length: u32;
- security_descriptor: rawptr;
- inherit_handle: BOOL;
+ length u32;
+ security_descriptor rawptr;
+ inherit_handle BOOL;
}
const INFINITE = 0xffffffff;
@@ -242,24 +242,24 @@ proc ReadBarrier () #foreign
// GDI
type BITMAPINFOHEADER struct #ordered {
- size: u32;
- width, height: i32;
- planes, bit_count: i16;
- compression: u32;
- size_image: u32;
- x_pels_per_meter: i32;
- y_pels_per_meter: i32;
- clr_used: u32;
- clr_important: u32;
+ size u32;
+ width, height i32;
+ planes, bit_count i16;
+ compression u32;
+ size_image u32;
+ x_pels_per_meter i32;
+ y_pels_per_meter i32;
+ clr_used u32;
+ clr_important u32;
}
type BITMAPINFO struct #ordered {
- using header: BITMAPINFOHEADER;
- colors: [1]RGBQUAD;
+ using header BITMAPINFOHEADER;
+ colors [1]RGBQUAD;
}
type RGBQUAD struct #ordered {
- blue, green, red, reserved: byte;
+ blue, green, red, reserved byte;
}
const BI_RGB = 0;
@@ -315,7 +315,7 @@ type wglCreateContextAttribsARBType proc(hdc HDC, hshareContext rawptr, attribLi
type PIXELFORMATDESCRIPTOR struct #ordered {
size,
version,
- flags: u32;
+ flags u32;
pixel_type,
color_bits,
@@ -336,11 +336,11 @@ type PIXELFORMATDESCRIPTOR struct #ordered {
stencil_bits,
aux_buffers,
layer_type,
- reserved: byte;
+ reserved byte;
layer_mask,
visible_mask,
- damage_mask: u32;
+ damage_mask u32;
}
proc GetDC (h HANDLE) -> HDC #foreign
diff --git a/core/utf8.odin b/core/utf8.odin
index 4a9a5bb84..73688fd75 100644
--- a/core/utf8.odin
+++ b/core/utf8.odin
@@ -11,7 +11,7 @@ const SURROGATE_MAX = 0xdfff;
type Accept_Range struct {
- lo, hi: u8;
+ lo, hi u8;
};
accept_ranges := [5]Accept_Range{