Rewriting constant casts into literals of said type

This commit is contained in:
Krzosa Karol
2022-06-22 14:01:15 +02:00
parent b0872e2303
commit f66b155e40
3 changed files with 45 additions and 17 deletions

View File

@@ -89,17 +89,15 @@ print :: (a: Any)
// print(a[i])
app_is_running := true
window_procedure :: (hwnd: HWND, msg: UINT, wparam: WPARAM, lparam: LPARAM): LRESULT
if msg == WM_DESTROY
PostQuitMessage(0)
app_is_running = false
return 0
else;; return DefWindowProcW(hwnd, msg, wparam, lparam)
little_untyped_test :: ()
if true == false;; pass
if true;; pass
cast_value1 := 32->S64
cast_value2 := true->Bool
WinMain :: (hInstance: HINSTANCE, hPrevInstance: HINSTANCE, lpCmdLine: LPSTR, nShowCmd: int): int
if good_scheduling := false, timeBeginPeriod(1) == TIMERR_NOERROR
good_scheduling = true
switch 4
4;; OutputDebugStringA("4")
3;; OutputDebugStringA("3")
some_type: Type = Vec2
char_info := get_type_info(char)
@@ -113,6 +111,19 @@ WinMain :: (hInstance: HINSTANCE, hPrevInstance: HINSTANCE, lpCmdLine: LPSTR, nS
#assert(int != char)
#assert(*char == *char)
app_is_running := true
window_procedure :: (hwnd: HWND, msg: UINT, wparam: WPARAM, lparam: LPARAM): LRESULT
if msg == WM_DESTROY
PostQuitMessage(0)
app_is_running = false
return 0
else;; return DefWindowProcW(hwnd, msg, wparam, lparam)
WinMain :: (hInstance: HINSTANCE, hPrevInstance: HINSTANCE, lpCmdLine: LPSTR, nShowCmd: int): int
if good_scheduling := false, timeBeginPeriod(1) == TIMERR_NOERROR
good_scheduling = true
arena: Arena
window_name := string_to_string16(&arena, "Have a wonderful day! 豈 更 車 賈 滑 串 句 龜 ")
w := WNDCLASSW{