Better support for Type types, squashing bugs due to pointer confusion etc.

This commit is contained in:
Krzosa Karol
2022-06-19 10:18:57 +02:00
parent 94b820a071
commit ade2638255
6 changed files with 56 additions and 17 deletions

View File

@@ -42,11 +42,22 @@ create_bitmap :: (size: Vec2I, bottom_up: Bool = true): Windows_Bitmap
return result
print :: (type: Type)
switch type
int, S64, S32, S16, S8
OutputDebugStringA("int")
default
OutputDebugStringA("unknown_type")
type_info := get_type_info(type)
if !type_info
return
switch type_info.kind
S64, S32, S16, S8, int
OutputDebugStringA("Integer")
U64, U32, U16, U8
OutputDebugStringA("Unsigned")
Type_Info_Kind.POINTER
OutputDebugStringA("*")
print(type_info.base_type)
Type_Info_Kind.SLICE
OutputDebugStringA("[]")
print(type_info.base_type)
default;; OutputDebugStringA("Unknown")
app_is_running := true
window_procedure :: (hwnd: HWND, msg: UINT, wparam: WPARAM, lparam: LPARAM): LRESULT
@@ -67,6 +78,7 @@ WinMain :: (hInstance: HINSTANCE, hPrevInstance: HINSTANCE, lpCmdLine: LPSTR, nS
if good_scheduling := false, timeBeginPeriod(1) == TIMERR_NOERROR
good_scheduling = true
print([]**S64)
char_info := get_type_info(char)
assert(char_info.kind == Type_Info_Kind.CHAR)
#assert(int == int)