From e7b790ae31b3c5d5e819f35f5fa8bd3619f7103f Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Mon, 16 Oct 2023 22:04:12 +0200 Subject: Fix Windows (MSVC) compiler warnings warning C4244: '=': conversion from 'double' to 'time_t', possible loss of data warning C4244: 'return': conversion from 'time_t' to 'long', possible loss of data --- src/Fl_Timeout.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Fl_Timeout.cxx b/src/Fl_Timeout.cxx index 17fcc4b92..bc3d0cb84 100644 --- a/src/Fl_Timeout.cxx +++ b/src/Fl_Timeout.cxx @@ -78,8 +78,8 @@ Fl_Timestamp Fl::now(double offset) { ts.sec = sec; ts.usec = usec; if (offset) { - sec = trunc(offset); - usec = (offset - sec) * 1000000; + sec = (time_t)trunc(offset); + usec = int((offset - sec) * 1000000); ts.sec += sec; if (usec + ts.usec >= 1000000) { ts.sec++; @@ -148,7 +148,7 @@ long Fl::ticks_since(Fl_Timestamp& then) { \see Fl::ticks_since(Fl_Timestamp& then) \see Fl::now() */ long Fl::ticks_between(Fl_Timestamp& back, Fl_Timestamp& further_back) { - return (back.sec-further_back.sec)*60 + (back.usec-further_back.usec)/16666; + return long((back.sec-further_back.sec)*60 + (back.usec-further_back.usec)/16666); } -- cgit v1.2.3