From 333e41eac6daf60c6aa9df0496a39c57d74b9c87 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 26 Sep 2022 17:38:25 +1000 Subject: Cleanup: replace C-style casts with functional casts for numeric types Use function style casts in C++ headers & source. --- intern/ghost/intern/GHOST_ContextGLX.cpp | 2 +- intern/ghost/intern/GHOST_XrAction.cpp | 2 +- intern/mikktspace/mikktspace.hh | 8 ++++---- intern/sky/source/sky_nishita.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'intern') diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp index e5f2e707f32..4c1e2705b50 100644 --- a/intern/ghost/intern/GHOST_ContextGLX.cpp +++ b/intern/ghost/intern/GHOST_ContextGLX.cpp @@ -320,7 +320,7 @@ GHOST_TSuccess GHOST_ContextGLX::getSwapInterval(int &intervalOut) ::glXQueryDrawable(m_display, m_window, GLX_SWAP_INTERVAL_EXT, &interval); - intervalOut = static_cast(interval); + intervalOut = int(interval); return GHOST_kSuccess; } diff --git a/intern/ghost/intern/GHOST_XrAction.cpp b/intern/ghost/intern/GHOST_XrAction.cpp index 0e725bf4075..9fbe033ade9 100644 --- a/intern/ghost/intern/GHOST_XrAction.cpp +++ b/intern/ghost/intern/GHOST_XrAction.cpp @@ -528,7 +528,7 @@ void *GHOST_XrActionSet::getCustomdata() uint32_t GHOST_XrActionSet::getActionCount() const { - return (uint32_t)m_actions.size(); + return uint32_t(m_actions.size()); } void GHOST_XrActionSet::getActionCustomdataArray(void **r_customdata_array) diff --git a/intern/mikktspace/mikktspace.hh b/intern/mikktspace/mikktspace.hh index 93e22658a56..2e5b0b065a8 100644 --- a/intern/mikktspace/mikktspace.hh +++ b/intern/mikktspace/mikktspace.hh @@ -151,7 +151,7 @@ template class Mikktspace { void genTangSpace() { - nrFaces = (uint)mesh.GetNumFaces(); + nrFaces = uint(mesh.GetNumFaces()); #ifdef WITH_TBB nrThreads = tbb::this_task_arena::max_concurrency(); @@ -276,7 +276,7 @@ template class Mikktspace { if (verts != 3 && verts != 4) continue; - uint tA = (uint)triangles.size(); + uint tA = uint(triangles.size()); triangles.emplace_back(f, nrTSpaces); Triangle &triA = triangles[tA]; @@ -284,7 +284,7 @@ template class Mikktspace { triA.setVertices(0, 1, 2); } else { - uint tB = (uint)triangles.size(); + uint tB = uint(triangles.size()); triangles.emplace_back(f, nrTSpaces); Triangle &triB = triangles[tB]; @@ -731,7 +731,7 @@ template class Mikktspace { continue; } - const uint newGroupId = (uint)groups.size(); + const uint newGroupId = uint(groups.size()); triangle.group[i] = newGroupId; groups.emplace_back(triangle.vertices[i], bool(triangle.orientPreserving)); diff --git a/intern/sky/source/sky_nishita.cpp b/intern/sky/source/sky_nishita.cpp index f1eab181189..d00ef51e152 100644 --- a/intern/sky/source/sky_nishita.cpp +++ b/intern/sky/source/sky_nishita.cpp @@ -316,7 +316,7 @@ void SKY_nishita_skymodel_precompute_texture(float *pixels, for (int y = start_y; y < end_y; y++) { /* sample more pixels toward the horizon */ - float latitude = (M_PI_2_F + half_lat_step) * sqr((float)y / height); + float latitude = (M_PI_2_F + half_lat_step) * sqr(float(y) / height); float *pixel_row = pixels + (y * width * stride); for (int x = 0; x < half_width; x++) { -- cgit v1.2.3