Qualify calls to certain functions from the cmath library.

This commit is contained in:
Erwin Coumans
2019-03-14 16:57:50 -07:00
parent 1161a04c56
commit 150a6a0880
13 changed files with 53 additions and 34 deletions

View File

@@ -21,6 +21,8 @@ subject to the following restrictions:
*/
#include <math.h>
#include <cmath>
#include "LinearR3.h"
#if 0
@@ -121,7 +123,7 @@ float unit(float vin[3], float vout[3])
if (dist > 0.0)
{
dist = sqrt(dist);
dist = std::sqrt(dist);
f = 1. / dist;
vout[0] = f * vin[0];
vout[1] = f * vin[1];

View File

@@ -11,6 +11,8 @@
#include <math.h>
#include <cmath>
namespace Gwen
{
namespace Renderer
@@ -87,16 +89,16 @@ void Base::Translate(int& x, int& y)
x += m_RenderOffset.x;
y += m_RenderOffset.y;
x = ceil(((float)x) * m_fScale);
y = ceil(((float)y) * m_fScale);
x = std::ceil(((float)x) * m_fScale);
y = std::ceil(((float)y) * m_fScale);
}
void Base::Translate(Gwen::Rect& rect)
{
Translate(rect.x, rect.y);
rect.w = ceil(((float)rect.w) * m_fScale);
rect.h = ceil(((float)rect.h) * m_fScale);
rect.w = std::ceil(((float)rect.w) * m_fScale);
rect.h = std::ceil(((float)rect.h) * m_fScale);
}
void Gwen::Renderer::Base::SetClipRegion(Gwen::Rect rect)
@@ -214,4 +216,4 @@ Gwen::Point Base::MeasureText(Gwen::Font* pFont, const Gwen::UnicodeString& text
return p;
}
} // namespace Renderer
} // namespace Gwen
} // namespace Gwen

View File

@@ -5,6 +5,7 @@
*/
#include <math.h>
#include <cmath>
#include "Gwen/Controls/Slider.h"
using namespace Gwen;
@@ -68,7 +69,7 @@ void Slider::SetValueInternal(float val)
{
if (m_bClampToNotches)
{
val = floor((val * (float)m_iNumNotches) + 0.5f);
val = std::floor((val * (float)m_iNumNotches) + 0.5f);
val /= (float)m_iNumNotches;
}
@@ -98,4 +99,4 @@ void Slider::RenderFocus(Gwen::Skin::Base* skin)
if (!IsTabable()) return;
skin->DrawKeyboardHighlight(this, GetRenderBounds(), 0);
}
}