Casting and documentation fixes (#608)

Add `-wDocumentation` option. Fix the documentation.
Fix c++20/c++17 confusion in tests.

Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
Marc
2023-03-31 17:13:48 +02:00
committed by GitHub
parent eed7e2ea70
commit 896c0f2f6e
22 changed files with 96 additions and 82 deletions

View File

@@ -99,9 +99,9 @@ class Gauge : public Node {
// Draw the progress bar horizontally.
{
const float progress = invert ? 1.F - progress_ : progress_;
const float limit =
(float)box_.x_min + progress * (float)(box_.x_max - box_.x_min + 1);
const int limit_int = (int)limit;
const auto limit =
float(box_.x_min) + progress * float(box_.x_max - box_.x_min + 1);
const int limit_int = static_cast<int>(limit);
int x = box_.x_min;
while (x < limit_int) {
screen.at(x++, y) = charset_horizontal[9]; // NOLINT
@@ -130,8 +130,8 @@ class Gauge : public Node {
{
const float progress = invert ? progress_ : 1.F - progress_;
const float limit =
(float)box_.y_min + progress * (float)(box_.y_max - box_.y_min + 1);
const int limit_int = (int)limit;
float(box_.y_min) + progress * float(box_.y_max - box_.y_min + 1);
const int limit_int = static_cast<int>(limit);
int y = box_.y_min;
while (y < limit_int) {
screen.at(x, y++) = charset_vertical[8]; // NOLINT