From: <man...@us...> - 2014-10-29 20:27:50
|
Revision: 4518 http://sourceforge.net/p/modplug/code/4518 Author: manxorist Date: 2014-10-29 20:27:35 +0000 (Wed, 29 Oct 2014) Log Message: ----------- [Fix] Silence clang 3.5 warning: "warning: absolute value function 'abs' given an argument of type 'const long' but has parameter of type 'int' which may cause truncation of value. note: use function 'std::abs' instead.". Use int32 instead of long here as it is a better fitting type anyway. Additionally, use std::abs instead of abs here, as suggested by clang. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-10-29 12:50:29 UTC (rev 4517) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-10-29 20:27:35 UTC (rev 4518) @@ -3312,7 +3312,7 @@ { //Behavior: Param tells number of finesteps(or 'fullsteps'(notes) with glissando) //to slide per row(not per tick). - const long old_PortamentoTickSlide = (m_PlayState.m_nTickCount != 0) ? pChn->m_PortamentoTickSlide : 0; + const int32 old_PortamentoTickSlide = (m_PlayState.m_nTickCount != 0) ? pChn->m_PortamentoTickSlide : 0; if(param) pChn->nPortamentoSlide = param; @@ -3333,9 +3333,9 @@ //With glissando interpreting param as notes instead of finesteps. } - const long slide = pChn->m_PortamentoTickSlide - old_PortamentoTickSlide; + const int32 slide = pChn->m_PortamentoTickSlide - old_PortamentoTickSlide; - if(abs(pChn->nPortamentoDest) <= abs(slide)) + if(std::abs(pChn->nPortamentoDest) <= std::abs(slide)) { if(pChn->nPortamentoDest != 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |