mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-30 06:10:28 +01:00
refactor(sonar): declare non-mutating member functions const (cpp:S5817)
Virtual functions are left untouched so overrides keep matching.
This commit is contained in:
@@ -59,7 +59,7 @@ world_environment::compute_season( int const Yearday ) {
|
||||
|
||||
// calculates current weather
|
||||
void
|
||||
world_environment::compute_weather() {
|
||||
world_environment::compute_weather() const {
|
||||
|
||||
Global.Weather = Global.Overcast <= 0.10 ? "clear:" :
|
||||
Global.Overcast <= 0.50 ? "scattered:" :
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
// calculates current season of the year based on set simulation date
|
||||
void compute_season( int const Yearday );
|
||||
// calculates current weather
|
||||
void compute_weather();
|
||||
void compute_weather() const;
|
||||
// data access
|
||||
inline auto const &
|
||||
sun() const {
|
||||
|
||||
@@ -146,7 +146,7 @@ scenario_time::year_day( int Day, const int Month, const int Year ) const {
|
||||
}
|
||||
|
||||
void
|
||||
scenario_time::daymonth( WORD &Day, WORD &Month, WORD const Year, WORD const Yearday ) {
|
||||
scenario_time::daymonth( WORD &Day, WORD &Month, WORD const Year, WORD const Yearday ) const {
|
||||
|
||||
WORD daytab[ 2 ][ 13 ] = {
|
||||
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
|
||||
|
||||
@@ -56,7 +56,7 @@ private:
|
||||
convert_transition_time( SYSTEMTIME &Time ) const;
|
||||
// calculates day and month from given day of year
|
||||
void
|
||||
daymonth( WORD &Day, WORD &Month, WORD const Year, WORD const Yearday );
|
||||
daymonth( WORD &Day, WORD &Month, WORD const Year, WORD const Yearday ) const;
|
||||
// calculates day of year from given date
|
||||
int
|
||||
year_day( int Day, int const Month, int const Year ) const;
|
||||
|
||||
Reference in New Issue
Block a user