Kaydet (Commit) 22cf6829 authored tarafından Noel Grandin's avatar Noel Grandin

clang-tidy performance-type-promotion-in-math-fn

Change-Id: I71405f1dbf0a1524e4e367ae5e05edaf6a8e98b8
Reviewed-on: https://gerrit.libreoffice.org/38559Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 4df450c2
......@@ -11,6 +11,7 @@
#include <epoxy/gl.h>
#include <cmath>
#include <glm/glm.hpp>
#include <glm/gtx/transform.hpp>
......@@ -821,7 +822,7 @@ void GL3DBarChart::create3DShapes(const std::vector<std::unique_ptr<VDataSeries>
mnMaxY = nSeriesIndex * (BAR_SIZE_Y + BAR_DISTANCE_Y) + 40;
if (!mbCameraInit)
{
mnDistance = sqrt(mnMaxX * mnMaxX + mnMaxY * mnMaxY + DEFAULT_CAMERA_HEIGHT * DEFAULT_CAMERA_HEIGHT);
mnDistance = std::sqrt(mnMaxX * mnMaxX + mnMaxY * mnMaxY + DEFAULT_CAMERA_HEIGHT * DEFAULT_CAMERA_HEIGHT);
maDefaultCameraDirection = glm::vec3(mnMaxX * 0.4, mnMaxY * 0.35, 0);
maDefaultCameraPosition = glm::vec3(maDefaultCameraDirection.x, maDefaultCameraDirection.y - mnDistance, DEFAULT_CAMERA_HEIGHT * 2);
mnCornerId = 0;
......@@ -1063,22 +1064,22 @@ glm::vec3 GL3DBarChart::getCornerPosition(sal_Int8 nId)
{
case 0:
{
return glm::vec3(mnMaxX / 2 - mnDistance * sin(pi / 4), mnMaxY / 2 - mnDistance * cos(pi / 4), DEFAULT_CAMERA_HEIGHT * 2);
return glm::vec3(mnMaxX / 2 - mnDistance * std::sin(pi / 4), mnMaxY / 2 - mnDistance * std::cos(pi / 4), DEFAULT_CAMERA_HEIGHT * 2);
}
break;
case 1:
{
return glm::vec3(mnMaxX / 2 + mnDistance * sin(pi / 4), mnMaxY / 2 - mnDistance * cos(pi / 4), DEFAULT_CAMERA_HEIGHT * 2);
return glm::vec3(mnMaxX / 2 + mnDistance * std::sin(pi / 4), mnMaxY / 2 - mnDistance * std::cos(pi / 4), DEFAULT_CAMERA_HEIGHT * 2);
}
break;
case 2:
{
return glm::vec3(mnMaxX / 2 + mnDistance * sin(pi / 4), mnMaxY / 2 + mnDistance * cos(pi / 4), DEFAULT_CAMERA_HEIGHT * 2);
return glm::vec3(mnMaxX / 2 + mnDistance * std::sin(pi / 4), mnMaxY / 2 + mnDistance * std::cos(pi / 4), DEFAULT_CAMERA_HEIGHT * 2);
}
break;
case 3:
{
return glm::vec3(mnMaxX / 2 - mnDistance * sin(pi / 4), mnMaxY / 2 + mnDistance * cos(pi / 4), DEFAULT_CAMERA_HEIGHT * 2);
return glm::vec3(mnMaxX / 2 - mnDistance * std::sin(pi / 4), mnMaxY / 2 + mnDistance * std::cos(pi / 4), DEFAULT_CAMERA_HEIGHT * 2);
}
break;
default:
......
......@@ -11,6 +11,7 @@
#include "GL3DRenderer.hxx"
#include <cmath>
#include <vcl/opengl/OpenGLHelper.hxx>
#include <vcl/font.hxx>
#include <vcl/virdev.hxx>
......@@ -606,8 +607,8 @@ int OpenGL3DRenderer::GenerateRoundCornerBar(std::vector<glm::vec3> &vertices, s
{
fNextAngleY = 360.0f;
}
float fSineY = sin(fCurAngleY/180.0f*PI), fCosY = cos(fCurAngleY/180.0f*PI);
float fNextSineY = sin(fNextAngleY/180.0f*PI), fNextCosY = cos(fNextAngleY/180.0f*PI);
float fSineY = std::sin(fCurAngleY/180.0f*PI), fCosY = std::cos(fCurAngleY/180.0f*PI);
float fNextSineY = std::sin(fNextAngleY/180.0f*PI), fNextCosY = std::cos(fNextAngleY/180.0f*PI);
glm::vec3 vDirY(fCosY, 0.0f, -fSineY), vNextDirY(fNextCosY, 0.0f, -fNextSineY);
float fCurAngleZ = 0.0f;
int iStepsZ = 1;
......@@ -633,8 +634,8 @@ int OpenGL3DRenderer::GenerateRoundCornerBar(std::vector<glm::vec3> &vertices, s
int yIndex = 0;
float fNextAngleZ = fCurAngleZ+fAddAngleZ;
float fSineZ = sin(fCurAngleZ/180.0f*PI), fCosZ = cos(fCurAngleZ/180.0f*PI);
float fNextSineZ = sin(fNextAngleZ/180.0f*PI), fNextCosZ = cos(fNextAngleZ/180.0f*PI);
float fSineZ = std::sin(fCurAngleZ/180.0f*PI), fCosZ = std::cos(fCurAngleZ/180.0f*PI);
float fNextSineZ = std::sin(fNextAngleZ/180.0f*PI), fNextCosZ = std::cos(fNextAngleZ/180.0f*PI);
if ((fCurAngleZ < 90.0f) && (fNextAngleZ >= 90.0f))
{
......
......@@ -8,6 +8,7 @@
*/
#include <epoxy/gl.h>
#include <cmath>
#include <vector>
#include "OpenGLRender.hxx"
#include <vcl/graph.hxx>
......@@ -387,8 +388,8 @@ int OpenGLRender::Create2DCircle(int detail)
m_Bubble2DCircle.push_back(0);
for(angle = 2.0f * GL_PI; angle > -(2.0f * GL_PI / detail); angle -= (2.0f * GL_PI / detail))
{
m_Bubble2DCircle.push_back(sin(angle));
m_Bubble2DCircle.push_back(cos(angle));
m_Bubble2DCircle.push_back(std::sin(angle));
m_Bubble2DCircle.push_back(std::cos(angle));
}
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment