Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-09-26 02:53:49 +0300
committerCampbell Barton <campbell@blender.org>2022-09-26 02:53:49 +0300
commit15f3cf7f8f956a6372b6a99788b622946ba3d1e5 (patch)
tree0ad4fe0aeb21ea4773088b0c92cc7bcb48d5e2a5 /intern
parente746999aa937f6de638a339d52e1f2e494014919 (diff)
Cleanup: replace C-style casts with functional casts for numeric types
Some changes missed from f68cfd6bb078482c4a779a6e26a56e2734edb5b8.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/blender/python.cpp2
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp10
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp4
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp2
-rw-r--r--intern/guardedalloc/tests/guardedalloc_alignment_test.cc2
5 files changed, 10 insertions, 10 deletions
diff --git a/intern/cycles/blender/python.cpp b/intern/cycles/blender/python.cpp
index 1e33b0b7207..077875aecb2 100644
--- a/intern/cycles/blender/python.cpp
+++ b/intern/cycles/blender/python.cpp
@@ -534,7 +534,7 @@ static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args)
socket_type = "NodeSocketBool";
data_type = BL::NodeSocket::type_BOOLEAN;
if (param->validdefault) {
- default_boolean = (bool)param->idefault[0];
+ default_boolean = bool(param->idefault[0]);
}
}
else {
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 5c58f9a856c..5a840d869b3 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -562,7 +562,7 @@ GHOST_TKey GHOST_SystemWin32::processSpecialKey(short vKey, short scanCode) cons
return key;
}
- char ch = (char)MapVirtualKeyA(vKey, MAPVK_VK_TO_CHAR);
+ char ch = char(MapVirtualKeyA(vKey, MAPVK_VK_TO_CHAR));
switch (ch) {
case u'\"':
case u'\'':
@@ -1747,10 +1747,10 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
break;
}
case WM_XBUTTONDOWN: {
- if ((short)HIWORD(wParam) == XBUTTON1) {
+ if (short(HIWORD(wParam)) == XBUTTON1) {
event = processButtonEvent(GHOST_kEventButtonDown, window, GHOST_kButtonMaskButton4);
}
- else if ((short)HIWORD(wParam) == XBUTTON2) {
+ else if (short(HIWORD(wParam)) == XBUTTON2) {
event = processButtonEvent(GHOST_kEventButtonDown, window, GHOST_kButtonMaskButton5);
}
break;
@@ -1768,10 +1768,10 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
break;
}
case WM_XBUTTONUP: {
- if ((short)HIWORD(wParam) == XBUTTON1) {
+ if (short(HIWORD(wParam)) == XBUTTON1) {
event = processButtonEvent(GHOST_kEventButtonUp, window, GHOST_kButtonMaskButton4);
}
- else if ((short)HIWORD(wParam) == XBUTTON2) {
+ else if (short(HIWORD(wParam)) == XBUTTON2) {
event = processButtonEvent(GHOST_kEventButtonUp, window, GHOST_kButtonMaskButton5);
}
break;
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index 5c1ac157980..89b4b31468b 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -1152,7 +1152,7 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
}
if (ELEM(status, XLookupChars, XLookupBoth)) {
- if ((unsigned char)utf8_buf[0] >= 32) { /* not an ascii control character */
+ if (uchar(utf8_buf[0]) >= 32) { /* not an ascii control character */
/* do nothing for now, this is valid utf8 */
}
else {
@@ -1165,7 +1165,7 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
}
else {
printf("Bad keycode lookup. Keysym 0x%x Status: %s\n",
- (unsigned int)key_sym,
+ uint(key_sym),
(status == XLookupNone ? "XLookupNone" :
status == XLookupKeySym ? "XLookupKeySym" :
"Unknown status"));
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index 50ee9385e39..e2d143ee5e6 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -89,7 +89,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system,
*/
}
- RECT win_rect = {left, top, (long)(left + width), (long)(top + height)};
+ RECT win_rect = {left, top, long(left + width), long(top + height)};
adjustWindowRectForClosestMonitor(&win_rect, style, extended_style);
wchar_t *title_16 = alloc_utf16_from_8((char *)title, 0);
diff --git a/intern/guardedalloc/tests/guardedalloc_alignment_test.cc b/intern/guardedalloc/tests/guardedalloc_alignment_test.cc
index ceda01c2fba..b1a2143c8dc 100644
--- a/intern/guardedalloc/tests/guardedalloc_alignment_test.cc
+++ b/intern/guardedalloc/tests/guardedalloc_alignment_test.cc
@@ -7,7 +7,7 @@
#include "MEM_guardedalloc.h"
#include "guardedalloc_test_base.h"
-#define CHECK_ALIGNMENT(ptr, align) EXPECT_EQ((size_t)ptr % align, 0)
+#define CHECK_ALIGNMENT(ptr, align) EXPECT_EQ(size_t(ptr) % align, 0)
namespace {