diff options
| author | kkard2 <[email protected]> | 2025-09-07 11:16:17 +0200 |
|---|---|---|
| committer | kkard2 <[email protected]> | 2025-09-07 11:16:17 +0200 |
| commit | fb416edfbdae410d993e0504f2e9f7deb6367a20 (patch) | |
| tree | a416aa5b6998eb6429d321bb33a16cbd1bc1a1e4 | |
| parent | 14288e6b15e8c8a61ccfcf859583268529776f11 (diff) | |
fix cl.exe warnings
| -rw-r--r-- | examples/texture.c | 2 | ||||
| -rw-r--r-- | platform_win32.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/texture.c b/examples/texture.c index 1a4382a..d6bee54 100644 --- a/examples/texture.c +++ b/examples/texture.c @@ -21,7 +21,7 @@ void init() { } texture.stride = texture.width; - texture.pixels = data; // NOTE(kard): be careful if changing following loop + texture.pixels = (uint32_t *)data; // NOTE(kard): be careful if changing following loop // converting from stbi's RGBA to ARGB for (size_t i = 0; i < texture.width * texture.height; i++) { diff --git a/platform_win32.c b/platform_win32.c index 226dbd7..2df92b6 100644 --- a/platform_win32.c +++ b/platform_win32.c @@ -52,13 +52,13 @@ void redirect_io_to_console() { AllocConsole(); FILE *fp; - fp = freopen("CONOUT$", "w", stdout); + assert(!freopen_s(&fp, "CONOUT$", "w", stdout)); setvbuf(stdout, NULL, _IONBF, 0); - fp = freopen("CONOUT$", "w", stderr); + assert(!freopen_s(&fp, "CONOUT$", "w", stderr)); setvbuf(stderr, NULL, _IONBF, 0); - fp = freopen("CONIN$", "r", stdin); + assert(!freopen_s(&fp, "CONIN$", "r", stdin)); setvbuf(stdin, NULL, _IONBF, 0); } @@ -183,7 +183,7 @@ int WinMain( actual_end.QuadPart = qpc_start.QuadPart + (TARGET_FRAME_TIME_US * qpc_freq.QuadPart / 1000000); remaining.QuadPart = (actual_end.QuadPart - qpc_end.QuadPart) * 1000000 / qpc_freq.QuadPart; if (remaining.QuadPart > 2000) { - Sleep((remaining.QuadPart - 1000) / 1000); + Sleep((DWORD)((remaining.QuadPart - 1000) / 1000)); } while (qpc_end.QuadPart < actual_end.QuadPart) { |
