base: avoid implicit conversions

This patch is a prerequisite for compiling the code with
the warnings -Wconversion enabled.

Issue #23
This commit is contained in:
Norman Feske
2021-12-02 11:21:14 +01:00
parent c79a59655d
commit 03047009b1
189 changed files with 947 additions and 819 deletions

View File

@ -23,7 +23,7 @@ using namespace Genode;
inline int lx_gettimeofday(struct timeval *tv, struct timeval *tz) {
return lx_syscall(SYS_gettimeofday, tv, tz); }
return (int)lx_syscall(SYS_gettimeofday, tv, tz); }
Microseconds Timer::Time_source::max_timeout() const
@ -44,8 +44,8 @@ Duration Timer::Time_source::curr_time()
void Timer::Time_source::_usleep(uint64_t us)
{
struct timespec ts;
ts.tv_sec = us / (1000 * 1000);
ts.tv_nsec = (us % (1000 * 1000)) * 1000;
ts.tv_sec = (long)us / (1000 * 1000);
ts.tv_nsec = ((long)us % (1000 * 1000)) * 1000;
if (lx_nanosleep(&ts, &ts) != 0)
throw Blocking_canceled();