summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2015-02-19 07:46:21 +0100
committerarchshift <admin@archshift.com>2015-02-20 07:26:25 +0100
commit4fb75d220aeaa66d3e907cc2311acf6c29433800 (patch)
tree8fa12b7d7dd3fde83ce126c0ffe3c8011d839f4f /src/core/hle/kernel
parentRemove duplication of INSERT_PADDING_WORDS between pica.h and gpu.h (diff)
downloadyuzu-4fb75d220aeaa66d3e907cc2311acf6c29433800.tar
yuzu-4fb75d220aeaa66d3e907cc2311acf6c29433800.tar.gz
yuzu-4fb75d220aeaa66d3e907cc2311acf6c29433800.tar.bz2
yuzu-4fb75d220aeaa66d3e907cc2311acf6c29433800.tar.lz
yuzu-4fb75d220aeaa66d3e907cc2311acf6c29433800.tar.xz
yuzu-4fb75d220aeaa66d3e907cc2311acf6c29433800.tar.zst
yuzu-4fb75d220aeaa66d3e907cc2311acf6c29433800.zip
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/thread.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index f8c834a8d..be1aed615 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -7,6 +7,7 @@
#include <vector>
#include "common/common.h"
+#include "common/math_util.h"
#include "common/thread_queue_list.h"
#include "core/arm/arm_interface.h"
@@ -339,7 +340,7 @@ static void DebugThreadQueue() {
ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, s32 priority,
u32 arg, s32 processor_id, VAddr stack_top) {
if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) {
- s32 new_priority = CLAMP(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST);
+ s32 new_priority = MathUtil::Clamp<s32>(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST);
LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d",
name.c_str(), priority, new_priority);
// TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm
@@ -387,7 +388,7 @@ static void ClampPriority(const Thread* thread, s32* priority) {
if (*priority < THREADPRIO_HIGHEST || *priority > THREADPRIO_LOWEST) {
DEBUG_ASSERT_MSG(false, "Application passed an out of range priority. An error should be returned.");
- s32 new_priority = CLAMP(*priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST);
+ s32 new_priority = MathUtil::Clamp<s32>(*priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST);
LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d",
thread->name.c_str(), *priority, new_priority);
// TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm