aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-02-19 11:31:14 +0000
committergingerBill <bill@gingerbill.org>2021-02-19 11:31:14 +0000
commitefdee0dafb2b7568242173cb4549aba32f6f9e75 (patch)
treecd1e66b987699f55f57c3c4f6097f1fb31cf0517 /core
parentf332cf498d83f4ef2da5ce1493347c1984cbf0d8 (diff)
Remove `bit_field` type from Odin (keyword and dead runtime code still exists)
Diffstat (limited to 'core')
-rw-r--r--core/os/os_windows.odin2
-rw-r--r--core/runtime/core.odin21
-rw-r--r--core/sys/win32/user32.odin7
-rw-r--r--core/sys/windows/kernel32.odin5
4 files changed, 18 insertions, 17 deletions
diff --git a/core/os/os_windows.odin b/core/os/os_windows.odin
index a6af811b5..48e3ac43c 100644
--- a/core/os/os_windows.odin
+++ b/core/os/os_windows.odin
@@ -195,4 +195,4 @@ is_windows_8_1 :: proc() -> bool {
is_windows_10 :: proc() -> bool {
osvi := get_windows_version_w();
return (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0);
-} \ No newline at end of file
+}
diff --git a/core/runtime/core.odin b/core/runtime/core.odin
index 2b8871f04..9671214d1 100644
--- a/core/runtime/core.odin
+++ b/core/runtime/core.odin
@@ -240,14 +240,14 @@ Typeid_Kind :: enum u8 {
}
#assert(len(Typeid_Kind) < 32);
-Typeid_Bit_Field :: bit_field #align align_of(uintptr) {
- index: 8*size_of(uintptr) - 8,
- kind: 5, // Typeid_Kind
- named: 1,
- special: 1, // signed, cstring, etc
- reserved: 1,
-}
-#assert(size_of(Typeid_Bit_Field) == size_of(uintptr));
+// Typeid_Bit_Field :: bit_field #align align_of(uintptr) {
+// index: 8*size_of(uintptr) - 8,
+// kind: 5, // Typeid_Kind
+// named: 1,
+// special: 1, // signed, cstring, etc
+// reserved: 1,
+// }
+// #assert(size_of(Typeid_Bit_Field) == size_of(uintptr));
// NOTE(bill): only the ones that are needed (not all types)
// This will be set by the compiler
@@ -417,8 +417,9 @@ type_info_core :: proc "contextless" (info: ^Type_Info) -> ^Type_Info {
type_info_base_without_enum :: type_info_core;
__type_info_of :: proc "contextless" (id: typeid) -> ^Type_Info {
- data := transmute(Typeid_Bit_Field)id;
- n := int(data.index);
+ MASK :: 1<<(8*size_of(typeid) - 8) - 1;
+ data := transmute(uintptr)id;
+ n := int(data & MASK);
if n < 0 || n >= len(type_table) {
n = 0;
}
diff --git a/core/sys/win32/user32.odin b/core/sys/win32/user32.odin
index 35a22b57f..ed05bbbaa 100644
--- a/core/sys/win32/user32.odin
+++ b/core/sys/win32/user32.odin
@@ -9,10 +9,9 @@ Menu_Bar_Info :: struct {
bar: Rect,
menu: Hmenu,
wnd_menu: Hwnd,
- using fields: bit_field {
- bar_focused: 1,
- focuses: 1,
- },
+ fields: u8,
+ // field.bar_focused: 1,
+ // field.focuses: 1,
}
Menu_Item_Info_A :: struct {
diff --git a/core/sys/windows/kernel32.odin b/core/sys/windows/kernel32.odin
index 85269fd6e..bfbc1d2dc 100644
--- a/core/sys/windows/kernel32.odin
+++ b/core/sys/windows/kernel32.odin
@@ -655,7 +655,8 @@ WIN32_MEMORY_REGION_INFORMATION_u :: struct #raw_union {
WIN32_MEMORY_REGION_INFORMATION_u_s :: struct {
Bitfield: ULONG,
}
-WIN32_MEMORY_REGION_INFORMATION_u_s_Bitfield :: bit_field #align align_of(ULONG) {
+WIN32_MEMORY_REGION_INFORMATION_u_s_Bitfield :: distinct ULONG;
+/*bit_field #align align_of(ULONG) {
Private : 1-0,
MappedDataFile : 2-1,
MappedImage : 3-2,
@@ -663,7 +664,7 @@ WIN32_MEMORY_REGION_INFORMATION_u_s_Bitfield :: bit_field #align align_of(ULONG)
MappedPhysical : 5-4,
DirectMapped : 6-5,
Reserved : 32-6,
-}
+}*/
foreign kernel32 {
QueryVirtualMemoryInformation :: proc(