From 254489e34c84a502e9400bfb631fa28ab1cf7128 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 29 Aug 2020 14:42:19 +0300 Subject: [PATCH] - fixed compilation warnings reported by MSVC src\common\audio\sound\s_sound.cpp(556,27): warning C4244: '=': conversion from 'double' to 'float', possible loss of data src\scripting\vmthunks.cpp(2678,13): warning C4244: 'return': conversion from 'time_t' to 'int', possible loss of data --- src/common/audio/sound/s_sound.cpp | 4 ++-- src/scripting/vmthunks.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/audio/sound/s_sound.cpp b/src/common/audio/sound/s_sound.cpp index 34ba9e269..c5e2bc072 100644 --- a/src/common/audio/sound/s_sound.cpp +++ b/src/common/audio/sound/s_sound.cpp @@ -554,8 +554,8 @@ FSoundChan *SoundEngine::StartSound(int type, const void *source, float sfxlength = (float)GSnd->GetMSLength(sfx->data) / 1000.f; startTime = (startflags & SNDF_LOOP) - ? (sfxlength > 0 ? fmod(startTime, sfxlength) : 0) - : clamp(startTime, 0.f, sfxlength); + ? (sfxlength > 0 ? fmodf(startTime, sfxlength) : 0.f) + : clamp(startTime, 0.f, sfxlength); if (attenuation > 0 && type != SOURCE_None) { diff --git a/src/scripting/vmthunks.cpp b/src/scripting/vmthunks.cpp index e913bec65..3d6b1f500 100644 --- a/src/scripting/vmthunks.cpp +++ b/src/scripting/vmthunks.cpp @@ -2675,7 +2675,7 @@ static int GetEpochTime() { time_t now; time(&now); - return now != (time_t)(-1) ? now + epochoffset : (time_t)(-1); + return now != (time_t)(-1) ? int(now + epochoffset) : -1; } //Returns an empty string if the Strf tokens are valid, otherwise returns the problematic token