ProgressBar: add `noexcept`
authorMax Kellermann <max@musicpd.org>
Mon, 9 Sep 2019 18:22:46 +0000 (20:22 +0200)
committerMax Kellermann <max@musicpd.org>
Mon, 9 Sep 2019 18:22:46 +0000 (20:22 +0200)
src/ProgressBar.cxx
src/ProgressBar.hxx

index c818df6..5fd17e9 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <assert.h>
 
-ProgressBar::ProgressBar(Point p, unsigned _width)
+ProgressBar::ProgressBar(Point p, unsigned _width) noexcept
        :window(p, {_width, 1u})
 {
        leaveok(window.w, true);
@@ -35,7 +35,7 @@ ProgressBar::ProgressBar(Point p, unsigned _width)
 }
 
 void
-ProgressBar::Paint() const
+ProgressBar::Paint() const noexcept
 {
        if (max > 0) {
                assert(width < window.size.width);
@@ -62,7 +62,7 @@ ProgressBar::Paint() const
 }
 
 bool
-ProgressBar::Calculate()
+ProgressBar::Calculate() noexcept
 {
        if (max == 0)
                return false;
@@ -75,7 +75,7 @@ ProgressBar::Calculate()
 }
 
 void
-ProgressBar::OnResize(Point p, unsigned _width)
+ProgressBar::OnResize(Point p, unsigned _width) noexcept
 {
        window.Resize({_width, 1u});
        window.Move(p);
@@ -84,7 +84,7 @@ ProgressBar::OnResize(Point p, unsigned _width)
 }
 
 bool
-ProgressBar::Set(unsigned _current, unsigned _max)
+ProgressBar::Set(unsigned _current, unsigned _max) noexcept
 {
        if (_current > _max)
                _current = _max;
index cdf9c83..e792622 100644 (file)
@@ -30,16 +30,16 @@ class ProgressBar {
        unsigned width = 0;
 
 public:
-       ProgressBar(Point p, unsigned _width);
+       ProgressBar(Point p, unsigned _width) noexcept;
 
-       void OnResize(Point p, unsigned _width);
+       void OnResize(Point p, unsigned _width) noexcept;
 
-       bool Set(unsigned current, unsigned max);
+       bool Set(unsigned current, unsigned max) noexcept;
 
-       void Paint() const;
+       void Paint() const noexcept;
 
 private:
-       bool Calculate();
+       bool Calculate() noexcept;
 };
 
 #endif