fix integer overflow
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user