From 3f745be1dc4df7ffeec89f1d90af41e139fb49db Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 27 Nov 2018 10:41:07 -0800 Subject: Return a signed integer from altime_get --- examples/common/alhelpers.c | 14 +++++++------- examples/common/alhelpers.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'examples/common') diff --git a/examples/common/alhelpers.c b/examples/common/alhelpers.c index c8f0bb37..3077d0b7 100644 --- a/examples/common/alhelpers.c +++ b/examples/common/alhelpers.c @@ -124,17 +124,17 @@ const char *FormatName(ALenum format) #include #include -unsigned int altime_get(void) +int altime_get(void) { - static unsigned int start_time = 0; - unsigned int cur_time; + static int start_time = 0; + int cur_time; union { FILETIME ftime; ULARGE_INTEGER ulint; } systime; GetSystemTimeAsFileTime(&systime.ftime); /* FILETIME is in 100-nanosecond units, or 1/10th of a microsecond. */ - cur_time = (unsigned int)(systime.ulint.QuadPart/10000); + cur_time = (int)(systime.ulint.QuadPart/10000); if(!start_time) start_time = cur_time; @@ -152,10 +152,10 @@ void al_nssleep(unsigned long nsec) #include #include -unsigned int altime_get(void) +int altime_get(void) { - static unsigned int start_time = 0u; - unsigned int cur_time; + static int start_time = 0u; + int cur_time; #if _POSIX_TIMERS > 0 struct timespec ts; diff --git a/examples/common/alhelpers.h b/examples/common/alhelpers.h index 4193e86f..5caeda38 100644 --- a/examples/common/alhelpers.h +++ b/examples/common/alhelpers.h @@ -17,7 +17,7 @@ int InitAL(char ***argv, int *argc); void CloseAL(void); /* Cross-platform timeget and sleep functions. */ -unsigned int altime_get(void); +int altime_get(void); void al_nssleep(unsigned long nsec); #ifdef __cplusplus -- cgit v1.2.3