Fix warnings (#115)

Fix visual studio warnings
This commit is contained in:
Ozan Tezcan 2023-04-22 00:41:11 +03:00 committed by GitHub
parent c2e8d56e76
commit 8df6817ff0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,7 @@ uint64_t time_ms(void)
void sleep_ms(uint64_t milliseconds) void sleep_ms(uint64_t milliseconds)
{ {
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)
Sleep(milliseconds); Sleep((DWORD) milliseconds);
#else #else
int rc; int rc;
struct timespec t; struct timespec t;
@ -89,7 +89,7 @@ void test1(void)
} }
int t = 10000; int t = 10000;
uint32_t n; uint64_t n;
while (t > 0) { while (t > 0) {
n = sc_timer_timeout(&timer, time_ms(), n = sc_timer_timeout(&timer, time_ms(),
(void *) (uintptr_t) 333, callback); (void *) (uintptr_t) 333, callback);
@ -145,7 +145,7 @@ void test2(void)
sc_timer_clear(&timer); sc_timer_clear(&timer);
int t = 10000; int t = 10000;
uint32_t n; uint64_t n;
while (t > 0) { while (t > 0) {
n = sc_timer_timeout(&timer, time_ms(), n = sc_timer_timeout(&timer, time_ms(),
(void *) (uintptr_t) 333, callback); (void *) (uintptr_t) 333, callback);
@ -209,7 +209,7 @@ void test3(void)
assert(count == 500); assert(count == 500);
int t = 10000; int t = 10000;
uint32_t n; uint64_t n;
while (t > 0) { while (t > 0) {
n = sc_timer_timeout(&timer, time_ms(), n = sc_timer_timeout(&timer, time_ms(),
(void *) (uintptr_t) 333, callback); (void *) (uintptr_t) 333, callback);
@ -250,7 +250,7 @@ void test4(void)
assert(count == 500); assert(count == 500);
int t = 10000; int t = 10000;
uint32_t n; uint64_t n;
int x = 0; int x = 0;
while (t > 0) { while (t > 0) {
x += 500; x += 500;