|
From: kosmirror <kos...@us...> - 2025-10-11 01:26:46
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via 37b3e38e701109afc0add0158fed74b3398ff1f3 (commit)
from 62f93b8ab81c39ee6c794d03d79270f5d5c63771 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 37b3e38e701109afc0add0158fed74b3398ff1f3
Author: kapodamy <168...@us...>
Date: Fri Oct 10 22:26:32 2025 -0300
Add missing/correct integer cast (#1226)
`tv_nsec`'s backing implementation is signed, so this helps avoid possible warnings.
-----------------------------------------------------------------------
Summary of changes:
include/kos/timer.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/kos/timer.h b/include/kos/timer.h
index fba1db59..89185e98 100644
--- a/include/kos/timer.h
+++ b/include/kos/timer.h
@@ -51,7 +51,7 @@ static inline timespec_t timer_gettime(void) {
static inline uint64_t timer_ms_gettime64(void) {
timespec_t time = timer_gettime();
- return (uint64_t)time.tv_sec * 1000 + time.tv_nsec / 1000000;
+ return (uint64_t)time.tv_sec * 1000 + (uint64_t)(time.tv_nsec / 1000000);
}
/** \brief Get the current uptime of the system (in microseconds).
@@ -64,7 +64,7 @@ static inline uint64_t timer_ms_gettime64(void) {
static inline uint64_t timer_us_gettime64(void) {
timespec_t time = timer_gettime();
- return (uint64_t)time.tv_sec * 1000000 + time.tv_nsec / 1000;
+ return (uint64_t)time.tv_sec * 1000000 + (uint64_t)(time.tv_nsec / 1000);
}
/** \brief Get the current uptime of the system (in nanoseconds).
@@ -77,7 +77,7 @@ static inline uint64_t timer_us_gettime64(void) {
static inline uint64_t timer_ns_gettime64(void) {
timespec_t time = timer_gettime();
- return (uint64_t)time.tv_sec * 1000000000 + time.tv_nsec;
+ return (uint64_t)time.tv_sec * 1000000000 + (uint64_t)time.tv_nsec;
}
/** \brief Get the current uptime of the system (in secs and millisecs).
@@ -98,7 +98,7 @@ static inline void timer_ms_gettime(uint32_t *secs, uint32_t *msecs) {
timespec_t time = timer_gettime();
if(secs) *secs = time.tv_sec;
- if(msecs) *msecs = time.tv_nsec / 1000000;
+ if(msecs) *msecs = (uint32_t)(time.tv_nsec / 1000000);
}
/** \brief Get the current uptime of the system (in secs and microsecs).
@@ -120,7 +120,7 @@ static inline void timer_us_gettime(uint32_t *secs, uint32_t *usecs) {
timespec_t time = timer_gettime();
if(secs) *secs = time.tv_sec;
- if(usecs) *usecs = time.tv_nsec / 1000;
+ if(usecs) *usecs = (uint32_t)(time.tv_nsec / 1000);
}
/** \brief Get the current uptime of the system (in secs and nanosecs).
@@ -142,7 +142,7 @@ static inline void timer_ns_gettime(uint32_t *secs, uint32_t *nsecs) {
timespec_t time = timer_gettime();
if(secs) *secs = time.tv_sec;
- if(nsecs) *nsecs = time.tv_nsec;
+ if(nsecs) *nsecs = (uint32_t)time.tv_nsec;
}
/** \brief Spin-loop delay function with microsecond granularity
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|