diff options
author | Campbell Barton <campbell@blender.org> | 2022-08-12 04:04:21 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-08-12 04:04:21 +0300 |
commit | d99ec7ff9e6f3e3954ad05aa4bf190aae10656d4 (patch) | |
tree | 1f2b04b1970d411a09eba7f865c6a9521f90cc10 /intern/ghost | |
parent | 75c5b21a1c93cf595da7daaffadb1f0c58ee04d5 (diff) |
Cleanup: clang-tidy GHOST Context/Event/TimerManager
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_Context.cpp | 6 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_Event.h | 2 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_TimerManager.cpp | 12 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_TimerManager.h | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/intern/ghost/intern/GHOST_Context.cpp b/intern/ghost/intern/GHOST_Context.cpp index f9aa80dc13d..9dd417521eb 100644 --- a/intern/ghost/intern/GHOST_Context.cpp +++ b/intern/ghost/intern/GHOST_Context.cpp @@ -35,7 +35,7 @@ bool win32_silent_chk(bool result) bool win32_chk(bool result, const char *file, int line, const char *text) { if (!result) { - LPTSTR formattedMsg = NULL; + LPTSTR formattedMsg = nullptr; DWORD error = GetLastError(); @@ -87,12 +87,12 @@ bool win32_chk(bool result, const char *file, int line, const char *text) default: { count = FormatMessage((FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS), - NULL, + nullptr, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)(&formattedMsg), 0, - NULL); + nullptr); msg = count > 0 ? formattedMsg : "<no system message>\n"; break; diff --git a/intern/ghost/intern/GHOST_Event.h b/intern/ghost/intern/GHOST_Event.h index 0813378a819..1e1c428e2ae 100644 --- a/intern/ghost/intern/GHOST_Event.h +++ b/intern/ghost/intern/GHOST_Event.h @@ -22,7 +22,7 @@ class GHOST_Event : public GHOST_IEvent { * \param window: The generating window (or NULL if system event). */ GHOST_Event(uint64_t msec, GHOST_TEventType type, GHOST_IWindow *window) - : m_type(type), m_time(msec), m_window(window), m_data(NULL) + : m_type(type), m_time(msec), m_window(window), m_data(nullptr) { } diff --git a/intern/ghost/intern/GHOST_TimerManager.cpp b/intern/ghost/intern/GHOST_TimerManager.cpp index 504cdbfb6c8..e54c2515029 100644 --- a/intern/ghost/intern/GHOST_TimerManager.cpp +++ b/intern/ghost/intern/GHOST_TimerManager.cpp @@ -71,10 +71,11 @@ uint64_t GHOST_TimerManager::nextFireTime() TTimerVector::iterator iter; for (iter = m_timers.begin(); iter != m_timers.end(); ++iter) { - uint64_t next = (*iter)->getNext(); + const uint64_t next = (*iter)->getNext(); - if (next < smallest) + if (next < smallest) { smallest = next; + } } return smallest; @@ -86,8 +87,9 @@ bool GHOST_TimerManager::fireTimers(uint64_t time) bool anyProcessed = false; for (iter = m_timers.begin(); iter != m_timers.end(); ++iter) { - if (fireTimer(time, *iter)) + if (fireTimer(time, *iter)) { anyProcessed = true; + } } return anyProcessed; @@ -113,9 +115,7 @@ bool GHOST_TimerManager::fireTimer(uint64_t time, GHOST_TimerTask *task) return true; } - else { - return false; - } + return false; } void GHOST_TimerManager::disposeTimers() diff --git a/intern/ghost/intern/GHOST_TimerManager.h b/intern/ghost/intern/GHOST_TimerManager.h index 090a84d1f14..4458a107190 100644 --- a/intern/ghost/intern/GHOST_TimerManager.h +++ b/intern/ghost/intern/GHOST_TimerManager.h @@ -87,7 +87,7 @@ class GHOST_TimerManager { */ void disposeTimers(); - typedef std::vector<GHOST_TimerTask *> TTimerVector; + using TTimerVector = std::vector<GHOST_TimerTask *>; /** The list with event consumers. */ TTimerVector m_timers; |