DateTimeController: make possible functions const
MonthShortToString and DayOfWeekShortToString don't change the underlying object. Those are just getters and can be declared `const`.
This commit is contained in:
parent
21da5869c5
commit
db41d9081a
|
@ -108,11 +108,11 @@ void DateTime::UpdateTime(uint32_t systickCounter) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* DateTime::MonthShortToString() {
|
const char* DateTime::MonthShortToString() const {
|
||||||
return MonthsString[static_cast<uint8_t>(month)];
|
return MonthsString[static_cast<uint8_t>(month)];
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* DateTime::DayOfWeekShortToString() {
|
const char* DateTime::DayOfWeekShortToString() const {
|
||||||
return DaysStringShort[static_cast<uint8_t>(dayOfWeek)];
|
return DaysStringShort[static_cast<uint8_t>(dayOfWeek)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,8 @@ namespace Pinetime {
|
||||||
return second;
|
return second;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* MonthShortToString();
|
const char* MonthShortToString() const;
|
||||||
const char* DayOfWeekShortToString();
|
const char* DayOfWeekShortToString() const;
|
||||||
static const char* MonthShortToStringLow(Months month);
|
static const char* MonthShortToStringLow(Months month);
|
||||||
|
|
||||||
std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> CurrentDateTime() const {
|
std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> CurrentDateTime() const {
|
||||||
|
|
Loading…
Reference in a new issue