Skip to content

Commit 5d8f044

Browse files
authored
Merge pull request #235 from Joe7M/master
Fix #232: TICKS stops working after 50 days
2 parents 657c25f + 4894068 commit 5d8f044

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/common/device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ void dev_destroy_file_list(char_p_t *list, int count);
10371037
* Returns the number of milliseconds that has passed since
10381038
* some unknown point in time.
10391039
*/
1040-
uint32_t dev_get_millisecond_count();
1040+
uint64_t dev_get_millisecond_count();
10411041

10421042
/**
10431043
* @ingroup dev_f

src/common/system.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,24 +216,23 @@ const char *dev_getenv_n(int n) {
216216
}
217217
#endif
218218

219-
uint32_t dev_get_millisecond_count(void) {
219+
uint64_t dev_get_millisecond_count(void) {
220220
#if defined(__MACH__)
221221
struct timeval t;
222222
gettimeofday(&t, NULL);
223-
return (uint32_t) (1000L * t.tv_sec + (t.tv_usec / 1000.0));
223+
return (uint64_t) (1000L * t.tv_sec + (t.tv_usec / 1000.0));
224224
#elif defined(_Win32)
225225
return GetTickCount();
226226
#else
227227
struct timespec t;
228228
t.tv_sec = t.tv_nsec = 0;
229229
if (0 == clock_gettime(CLOCK_MONOTONIC, &t)) {
230-
return (uint32_t) (1000L * t.tv_sec + (t.tv_nsec / 1e6));
230+
return (uint64_t) (1000L * t.tv_sec + (t.tv_nsec / 1e6));
231231
} else {
232232
struct timeval now;
233233
gettimeofday(&now, NULL);
234-
return (uint32_t) (1000L * now.tv_sec + (now.tv_usec / 1000.0));
234+
return (uint64_t) (1000L * now.tv_sec + (now.tv_usec / 1000.0));
235235
}
236236
#endif
237237
}
238238

239-

0 commit comments

Comments
 (0)