- 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
This commit is contained in:
alexey.lysiuk 2020-08-29 14:42:19 +03:00
parent 60886f389c
commit 254489e34c
2 changed files with 3 additions and 3 deletions

View file

@ -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<float>(startTime, 0.f, sfxlength);
? (sfxlength > 0 ? fmodf(startTime, sfxlength) : 0.f)
: clamp(startTime, 0.f, sfxlength);
if (attenuation > 0 && type != SOURCE_None)
{

View file

@ -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