aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/stopwatch/StopWatchController.cpp
diff options
context:
space:
mode:
authorcodingjourney <coding@journey.sk>2024-12-14 07:27:56 +0100
committerJF <JF002@users.noreply.github.com>2025-11-04 21:25:31 +0100
commite53e4ed23c54b6ecdd32691a618912b9158161fe (patch)
treee81540170d537fe1d1f112e3fb32b0409d9de066 /src/components/stopwatch/StopWatchController.cpp
parent8a5c637eb7210aa6a69f90567c55ee2b1afd5706 (diff)
tightened declarations of integer fields
Diffstat (limited to 'src/components/stopwatch/StopWatchController.cpp')
-rw-r--r--src/components/stopwatch/StopWatchController.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/components/stopwatch/StopWatchController.cpp b/src/components/stopwatch/StopWatchController.cpp
index 4979ee68..d21f6508 100644
--- a/src/components/stopwatch/StopWatchController.cpp
+++ b/src/components/stopwatch/StopWatchController.cpp
@@ -22,7 +22,7 @@ void StopWatchController::Clear() {
currentState = StopWatchStates::Cleared;
timeElapsedPreviously = 0;
- for (int i = 0; i < histSize; i++) {
+ for (uint8_t i = 0; i < histSize; i++) {
history[i].number = 0;
history[i].timeSinceStart = 0;
}
@@ -38,12 +38,12 @@ void StopWatchController::AddLapToHistory() {
history[0].number = ++maxLapNumber % lapNumberBoundary;
}
-int StopWatchController::GetMaxLapNumber() {
+uint16_t StopWatchController::GetMaxLapNumber() {
return maxLapNumber;
}
-std::optional<LapInfo> StopWatchController::GetLapFromHistory(int index) {
- if (index < 0 || index >= histSize || history[index].number == 0) {
+std::optional<LapInfo> StopWatchController::GetLapFromHistory(uint8_t index) {
+ if (index >= histSize || history[index].number == 0) {
return {};
}
return history[index];