aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-05-12 10:27:14 +0100
committerGinger Bill <bill@gingerbill.org>2017-05-12 10:27:14 +0100
commit45eecc0905fa72b17a74b2a258598eae1da10597 (patch)
treea558b74855d8b13b8889448383b962315995cd22 /core
parent87f1a62ca4280105eb845e5bae3acd8b8a0a0810 (diff)
Reimplement #ordered again
Diffstat (limited to 'core')
-rw-r--r--core/_preload.odin14
-rw-r--r--core/os_linux.odin4
-rw-r--r--core/os_x.odin4
-rw-r--r--core/sys/windows.odin32
4 files changed, 27 insertions, 27 deletions
diff --git a/core/_preload.odin b/core/_preload.odin
index ebdf55702..90ebcde56 100644
--- a/core/_preload.odin
+++ b/core/_preload.odin
@@ -25,7 +25,7 @@ Calling_Convention :: enum {
FAST = 3,
}
-Type_Info_Record :: struct {
+Type_Info_Record :: struct #ordered {
types: []^Type_Info,
names: []string,
offsets: []int, // offsets may not be used in tuples
@@ -144,13 +144,13 @@ Allocator_Mode :: enum u8 {
Allocator_Proc :: #type proc(allocator_data: rawptr, mode: Allocator_Mode,
size, alignment: int,
old_memory: rawptr, old_size: int, flags: u64) -> rawptr;
-Allocator :: struct {
+Allocator :: struct #ordered {
procedure: Allocator_Proc,
data: rawptr,
}
-Context :: struct {
+Context :: struct #ordered {
thread_id: int,
allocator: Allocator,
@@ -559,18 +559,18 @@ __default_hash_string :: proc(s: string) -> u64 {
__INITIAL_MAP_CAP :: 16;
-__Map_Key :: struct {
+__Map_Key :: struct #ordered {
hash: u64,
str: string,
}
-__Map_Find_Result :: struct {
+__Map_Find_Result :: struct #ordered {
hash_index: int,
entry_prev: int,
entry_index: int,
}
-__Map_Entry_Header :: struct {
+__Map_Entry_Header :: struct #ordered {
key: __Map_Key,
next: int,
/*
@@ -578,7 +578,7 @@ __Map_Entry_Header :: struct {
*/
}
-__Map_Header :: struct {
+__Map_Header :: struct #ordered {
m: ^raw.Dynamic_Map,
is_key_string: bool,
entry_size: int,
diff --git a/core/os_linux.odin b/core/os_linux.odin
index eeea9bf56..90250a625 100644
--- a/core/os_linux.odin
+++ b/core/os_linux.odin
@@ -36,7 +36,7 @@ RTLD_GLOBAL :: 0x100;
// "Argv" arguments converted to Odin strings
immutable args := _alloc_command_line_arguments();
-_File_Time :: struct {
+_File_Time :: struct #ordered {
seconds: i64,
nanoseconds: i32,
reserved: i32,
@@ -46,7 +46,7 @@ _File_Time :: struct {
// https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/+/jb-dev/sysroot/usr/include/bits/stat.h
// Validity is not guaranteed.
-Stat :: struct {
+Stat :: struct #ordered {
device_id: u64, // ID of device containing file
serial: u64, // File serial number
nlink: u32, // Number of hard links
diff --git a/core/os_x.odin b/core/os_x.odin
index a330d1350..ecbed3f27 100644
--- a/core/os_x.odin
+++ b/core/os_x.odin
@@ -41,12 +41,12 @@ RTLD_FIRST :: 0x100;
args: [dynamic]string;
-FileTime :: struct {
+FileTime :: struct #ordered {
seconds: i64,
nanoseconds: i64
}
-Stat :: struct {
+Stat :: struct #ordered {
device_id : i32, // ID of device containing file
mode : u16, // Mode of the file
nlink : u16, // Number of hard links
diff --git a/core/sys/windows.odin b/core/sys/windows.odin
index 82d0d8953..7ea62bb4c 100644
--- a/core/sys/windows.odin
+++ b/core/sys/windows.odin
@@ -65,11 +65,11 @@ SM_CYSCREEN :: 1;
SW_SHOW :: 5;
-Point :: struct {
+Point :: struct #ordered {
x, y: i32,
}
-WndClassExA :: struct {
+WndClassExA :: struct #ordered {
size, style: u32,
wnd_proc: Wnd_Proc,
cls_extra, wnd_extra: i32,
@@ -81,7 +81,7 @@ WndClassExA :: struct {
sm: Hicon,
}
-Msg :: struct {
+Msg :: struct #ordered {
hwnd: Hwnd,
message: u32,
wparam: Wparam,
@@ -90,24 +90,24 @@ Msg :: struct {
pt: Point,
}
-Rect :: struct {
+Rect :: struct #ordered {
left: i32,
top: i32,
right: i32,
bottom: i32,
}
-Filetime :: struct {
+Filetime :: struct #ordered {
lo, hi: u32,
}
-Systemtime :: struct {
+Systemtime :: struct #ordered {
year, month: u16,
day_of_week, day: u16,
hour, minute, second, millisecond: u16,
}
-By_Handle_File_Information :: struct {
+By_Handle_File_Information :: struct #ordered {
file_attributes: u32,
creation_time,
last_access_time,
@@ -120,7 +120,7 @@ By_Handle_File_Information :: struct {
file_index_low: u32,
}
-File_Attribute_Data :: struct {
+File_Attribute_Data :: struct #ordered {
file_attributes: u32,
creation_time,
last_access_time,
@@ -129,7 +129,7 @@ File_Attribute_Data :: struct {
file_size_low: u32,
}
-Find_Data :: struct {
+Find_Data :: struct #ordered {
file_attributes : u32,
creation_time : Filetime,
last_access_time : Filetime,
@@ -299,7 +299,7 @@ HEAP_ZERO_MEMORY :: 0x00000008;
// Synchronization
-Security_Attributes :: struct {
+Security_Attributes :: struct #ordered {
length: u32,
security_descriptor: rawptr,
inherit_handle: Bool,
@@ -350,14 +350,14 @@ SWP_NOSIZE :: 0x0001;
SWP_NOMOVE :: 0x0002;
-Monitor_Info :: struct {
+Monitor_Info :: struct #ordered {
size: u32,
monitor: Rect,
work: Rect,
flags: u32,
}
-Window_Placement :: struct {
+Window_Placement :: struct #ordered {
length: u32,
flags: u32,
show_cmd: u32,
@@ -394,7 +394,7 @@ LOWORD :: proc(lParam: Lparam) -> u16 { return u16(lParam); }
-Bitmap_Info_Header :: struct {
+Bitmap_Info_Header :: struct #ordered {
size: u32,
width, height: i32,
planes, bit_count: i16,
@@ -405,13 +405,13 @@ Bitmap_Info_Header :: struct {
clr_used: u32,
clr_important: u32,
}
-Bitmap_Info :: struct {
+Bitmap_Info :: struct #ordered {
using header: Bitmap_Info_Header,
colors: [1]Rgb_Quad,
}
-Rgb_Quad :: struct { blue, green, red, reserved: byte }
+Rgb_Quad :: struct #ordered { blue, green, red, reserved: byte }
BI_RGB :: 0;
DIB_RGB_COLORS :: 0x00;
@@ -457,7 +457,7 @@ PFD_DOUBLEBUFFER_DONTCARE :: 0x40000000;
PFD_STEREO_DONTCARE :: 0x80000000;
-PIXELFORMATDESCRIPTOR :: struct {
+PIXELFORMATDESCRIPTOR :: struct #ordered {
size,
version,
flags: u32,