summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2021-08-15 21:29:39 -0400
committer AJR <ajrhacker@users.noreply.github.com>2021-08-15 21:32:53 -0400
commit0298e5d6c376f5df0cefe1b9a84840eba39f0ebc (patch)
tree719da5f05bade2379610254ce842e0896ed0bd71 /src/devices/bus
parent08a0e5af5be40da3b97302d85961f32ddee2bd54 (diff)
Use std::clamp in more source files
Diffstat (limited to 'src/devices/bus')
-rw-r--r--src/devices/bus/snes/rom21.cpp4
-rw-r--r--src/devices/bus/sunmouse/hlemouse.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/devices/bus/snes/rom21.cpp b/src/devices/bus/snes/rom21.cpp
index 8cc1f6fddb6..9bf43d05894 100644
--- a/src/devices/bus/snes/rom21.cpp
+++ b/src/devices/bus/snes/rom21.cpp
@@ -128,8 +128,8 @@ uint8_t sns_rom21_srtc_device::srtc_weekday( uint32_t year, uint32_t month, uint
uint32_t sum = 0; // Number of days passed since epoch
year = std::max(1900U, year);
- month = std::max(1U, std::min(12U, month));
- day = std::max(1U, std::min(31U, day));
+ month = std::clamp(month, 1U, 12U);
+ day = std::clamp(day, 1U, 31U);
while (y < year)
{
diff --git a/src/devices/bus/sunmouse/hlemouse.cpp b/src/devices/bus/sunmouse/hlemouse.cpp
index e3d11558f75..97bae888600 100644
--- a/src/devices/bus/sunmouse/hlemouse.cpp
+++ b/src/devices/bus/sunmouse/hlemouse.cpp
@@ -53,7 +53,7 @@ INPUT_PORTS_END
uint8_t extract_delta_byte(int32_t &delta)
{
- int32_t const result(std::min<int32_t>(std::max<int32_t>(delta, -120), 127));
+ int32_t const result(std::clamp<int32_t>(delta, -120, 127));
delta -= result;
return uint8_t(int8_t(result));
}