From de4c97758af117af97fad58e4a80ffeba0154ba8 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 7 Apr 2022 13:23:40 +0300 Subject: Fix more issues found by cppcheck. --- servers/rendering_server.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'servers/rendering_server.cpp') diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index b58e6138eb..c2a6b83485 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -424,7 +424,7 @@ Error RenderingServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint value |= CLAMP(int((src[i * 4 + 1] * 0.5 + 0.5) * 1023.0), 0, 1023) << 10; value |= CLAMP(int((src[i * 4 + 2] * 0.5 + 0.5) * 1023.0), 0, 1023) << 20; if (src[i * 4 + 3] > 0) { - value |= 3 << 30; + value |= 3UL << 30; } memcpy(&vw[p_offsets[ai] + i * p_vertex_stride], &value, 4); @@ -440,7 +440,7 @@ Error RenderingServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint value |= CLAMP(int((src[i * 4 + 1] * 0.5 + 0.5) * 1023.0), 0, 1023) << 10; value |= CLAMP(int((src[i * 4 + 2] * 0.5 + 0.5) * 1023.0), 0, 1023) << 20; if (src[i * 4 + 3] > 0) { - value |= 3 << 30; + value |= 3UL << 30; } memcpy(&vw[p_offsets[ai] + i * p_vertex_stride], &value, 4); } @@ -1093,7 +1093,7 @@ Array RenderingServer::_get_array_from_surface(uint32_t p_format, Vector(&r[j * vertex_elem_size + offsets[i]]); w[j] = Vector2(v[0], v[1]); } } @@ -1107,7 +1107,7 @@ Array RenderingServer::_get_array_from_surface(uint32_t p_format, Vector(&r[j * vertex_elem_size + offsets[i]]); w[j] = Vector3(v[0], v[1], v[2]); } } @@ -1156,7 +1156,7 @@ Array RenderingServer::_get_array_from_surface(uint32_t p_format, Vector(&ar[j * attrib_elem_size + offsets[i]]); w[j] = Color(v[0] / 255.0, v[1] / 255.0, v[2] / 255.0, v[3] / 255.0); } @@ -1170,7 +1170,7 @@ Array RenderingServer::_get_array_from_surface(uint32_t p_format, Vector(&ar[j * attrib_elem_size + offsets[i]]); w[j] = Vector2(v[0], v[1]); } @@ -1184,7 +1184,7 @@ Array RenderingServer::_get_array_from_surface(uint32_t p_format, Vector(&ar[j * attrib_elem_size + offsets[i]]); w[j] = Vector2(v[0], v[1]); } @@ -1209,7 +1209,7 @@ Array RenderingServer::_get_array_from_surface(uint32_t p_format, Vector(&ar[j * attrib_elem_size + offsets[i]]); memcpy(&w[j * s], v, s); } @@ -1228,7 +1228,7 @@ Array RenderingServer::_get_array_from_surface(uint32_t p_format, Vector(&ar[j * attrib_elem_size + offsets[i]]); memcpy(&w[j * s], v, s * sizeof(float)); } ret[i] = arr; -- cgit v1.2.3