diff options
author | Chris Robinson <[email protected]> | 2018-11-27 10:41:07 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-27 12:11:11 -0800 |
commit | 3f745be1dc4df7ffeec89f1d90af41e139fb49db (patch) | |
tree | 9a37b5cc42bd0dbfdb4f59b9f4bd6cef81f1fc02 /examples/common | |
parent | ff6dda06ad66d71d4178bfa2aee282abe6c3ec23 (diff) |
Return a signed integer from altime_get
Diffstat (limited to 'examples/common')
-rw-r--r-- | examples/common/alhelpers.c | 14 | ||||
-rw-r--r-- | examples/common/alhelpers.h | 2 |
2 files changed, 8 insertions, 8 deletions
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 <windows.h> #include <mmsystem.h> -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 <unistd.h> #include <time.h> -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 |