|
37 | 37 | ); \ |
38 | 38 | } \ |
39 | 39 | \ |
40 | | - (time) = (((sys_system.wHour * 3600) + (sys_system.wMinute * 60) + \ |
41 | | - sys_system.wSecond) * NANOS_PER_SEC) + \ |
42 | | - (sys_system.wMilliseconds * 1000000) + \ |
43 | | - (((sys_user.wHour * 3600) + (sys_user.wMinute * 60) + \ |
44 | | - sys_user.wSecond) * NANOS_PER_SEC) + \ |
45 | | - (sys_user.wMilliseconds * 1000000); \ |
| 40 | + (time) = (((uvwasi_timestamp_t)(sys_system.wHour * 3600) + \ |
| 41 | + (sys_system.wMinute * 60) + sys_system.wSecond) * NANOS_PER_SEC) + \ |
| 42 | + ((uvwasi_timestamp_t)(sys_system.wMilliseconds) * 1000000) + \ |
| 43 | + (((uvwasi_timestamp_t)(sys_user.wHour * 3600) + \ |
| 44 | + (sys_user.wMinute * 60) + sys_user.wSecond) * NANOS_PER_SEC) + \ |
| 45 | + ((uvwasi_timestamp_t)(sys_user.wMilliseconds) * 1000000); \ |
46 | 46 | return UVWASI_ESUCCESS; \ |
47 | 47 | } while (0) |
48 | 48 |
|
|
52 | 52 | struct timespec ts; \ |
53 | 53 | if (0 != clock_gettime((clk), &ts)) \ |
54 | 54 | return uvwasi__translate_uv_error(uv_translate_sys_error(errno)); \ |
55 | | - (time) = (ts.tv_sec * NANOS_PER_SEC) + ts.tv_nsec; \ |
| 55 | + (time) = ((uvwasi_timestamp_t)(ts.tv_sec) * NANOS_PER_SEC) + ts.tv_nsec; \ |
56 | 56 | return UVWASI_ESUCCESS; \ |
57 | 57 | } while (0) |
58 | 58 |
|
|
62 | 62 | struct rusage ru; \ |
63 | 63 | if (0 != getrusage((who), &ru)) \ |
64 | 64 | return uvwasi__translate_uv_error(uv_translate_sys_error(errno)); \ |
65 | | - (time) = (ru.ru_utime.tv_sec * NANOS_PER_SEC) + \ |
| 65 | + (time) = ((uvwasi_timestamp_t)(ru.ru_utime.tv_sec) * NANOS_PER_SEC) + \ |
66 | 66 | (ru.ru_utime.tv_usec * 1000) + \ |
67 | | - (ru.ru_stime.tv_sec * NANOS_PER_SEC) + \ |
| 67 | + ((uvwasi_timestamp_t)(ru.ru_stime.tv_sec) * NANOS_PER_SEC) + \ |
68 | 68 | (ru.ru_stime.tv_usec * 1000); \ |
69 | 69 | return UVWASI_ESUCCESS; \ |
70 | 70 | } while (0) |
|
83 | 83 | &count)) { \ |
84 | 84 | return UVWASI_ENOSYS; \ |
85 | 85 | } \ |
86 | | - (time) = (info.user_time.seconds * NANOS_PER_SEC) + \ |
| 86 | + (time) = ((uvwasi_timestamp_t)(info.user_time.seconds) * NANOS_PER_SEC) + \ |
87 | 87 | (info.user_time.microseconds * 1000) + \ |
88 | | - (info.system_time.seconds * NANOS_PER_SEC) + \ |
| 88 | + ((uvwasi_timestamp_t)(info.system_time.seconds) * NANOS_PER_SEC) + \ |
89 | 89 | (info.system_time.microseconds * 1000); \ |
90 | 90 | return UVWASI_ESUCCESS; \ |
91 | 91 | } while (0) |
|
109 | 109 | if (0 != clock_getres((clk), &ts)) \ |
110 | 110 | (time) = 1000000; \ |
111 | 111 | else \ |
112 | | - (time) = (ts.tv_sec * NANOS_PER_SEC) + ts.tv_nsec; \ |
| 112 | + (time) = ((uvwasi_timestamp_t)(ts.tv_sec) * NANOS_PER_SEC) + ts.tv_nsec; \ |
113 | 113 | return UVWASI_ESUCCESS; \ |
114 | 114 | } while (0) |
115 | 115 |
|
|
0 commit comments