fix integer overflow

This commit is contained in:
Jonas Zeunert
2022-02-25 22:11:19 +01:00
parent 95ca5b4901
commit 7c56b1d6c7
6 changed files with 6 additions and 6 deletions

View File

@@ -30,7 +30,7 @@ std::string Display::get_name() const
return this->name;
}
void Display::write_score(const unsigned int & score, const unsigned int & length)
void Display::write_score(const uint64_t & score, const unsigned int & length)
{
auto score_string = std::to_string(score);

View File

@@ -27,7 +27,7 @@ public:
Display(const uint8_t & address, const std::string & name);
virtual ~Display() = default;
void write_score(const unsigned int & score, const unsigned int & length);
void write_score(const uint64_t & score, const unsigned int & length);
void write_content(std::string & content, const unsigned int & length);
std::string get_content() const override;

View File

@@ -31,7 +31,7 @@ public:
~EightDigitDisplay() override = default;
void write_score(unsigned int score) override
void write_score(uint64_t score) override
{
detail::Display::write_score(score, 8);
}

View File

@@ -27,7 +27,7 @@ public:
CLOG(DEBUG, OUTPUT_LOGGER) << "Created SevenDigitDisplay " << name << " with address " << int{this->address};
}
void write_score(unsigned int score) override
void write_score(uint64_t score) override
{
detail::Display::write_score(score, 7);
}