From f3f4b332aefdc624d97dcc058a6cad1c7fc7c2ec Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 10 Aug 2013 11:29:05 +0200 Subject: event/MultiSocketMonitor: use uint64_t instead of gint64 Unsigned and portable. --- src/event/MultiSocketMonitor.cxx | 6 +++--- src/event/MultiSocketMonitor.hxx | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/event/MultiSocketMonitor.cxx b/src/event/MultiSocketMonitor.cxx index 3fcc4375c..6ea0cb030 100644 --- a/src/event/MultiSocketMonitor.cxx +++ b/src/event/MultiSocketMonitor.cxx @@ -43,7 +43,7 @@ MultiSocketMonitor::MultiSocketMonitor(EventLoop &_loop) :loop(_loop), source((Source *)g_source_new(&multi_socket_monitor_source_funcs, sizeof(*source))), - absolute_timeout_us(G_MAXINT64) { + absolute_timeout_us(-1) { source->monitor = this; g_source_attach(&source->base, loop.GetContext()); @@ -61,8 +61,8 @@ MultiSocketMonitor::Prepare(gint *timeout_r) { int timeout_ms = *timeout_r = PrepareSockets(); absolute_timeout_us = timeout_ms < 0 - ? G_MAXINT64 - : GetTime() + gint64(timeout_ms) * 1000; + ? uint64_t(-1) + : GetTime() + uint64_t(timeout_ms) * 1000; return false; } diff --git a/src/event/MultiSocketMonitor.hxx b/src/event/MultiSocketMonitor.hxx index 941487534..f6ce43d52 100644 --- a/src/event/MultiSocketMonitor.hxx +++ b/src/event/MultiSocketMonitor.hxx @@ -29,6 +29,7 @@ #include #include +#include #ifdef WIN32 /* ERRORis a WIN32 macro that poisons our namespace; this is a @@ -52,7 +53,7 @@ class MultiSocketMonitor { EventLoop &loop; Source *source; - gint64 absolute_timeout_us; + uint64_t absolute_timeout_us; std::forward_list fds; public: @@ -69,7 +70,7 @@ public: } gcc_pure - gint64 GetTime() const { + uint64_t GetTime() const { return g_source_get_time(&source->base); } -- cgit v1.2.3