From c83814d90b1c9874cd03f35ace24cb038bbd4a9f Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Fri, 22 May 2020 16:51:14 +0100 Subject: [PATCH] Move min & max to Util and deprecate --- main.cc | 12 ------------ util.cc | 14 ++++++++++++++ util.h | 6 ++++++ wpictureview.cc | 13 ++++++------- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/main.cc b/main.cc index de56e17..506f7fe 100644 --- a/main.cc +++ b/main.cc @@ -279,18 +279,6 @@ int getClockRealTime(struct timespec *tp) // FIXME - del if all goes chrono return clock_gettime(CLOCK_REALTIME, tp); } -int min(UINT a, int b) -{ - if (a > b) return b; - else return a; -} - -int max(int a, int b) -{ - if (a > b) return a; - else return b; -} - const std::string& getCommandLineServer() { return argvServer; diff --git a/util.cc b/util.cc index 8d53208..e0b762e 100644 --- a/util.cc +++ b/util.cc @@ -120,3 +120,17 @@ ULLONG ntohll(ULLONG a) } */ + + +int min(UINT a, int b) +{ + if (a > b) return b; + else return a; +} + +int max(int a, int b) +{ + if (a > b) return a; + else return b; +} + diff --git a/util.h b/util.h index b4a9153..25be8ad 100644 --- a/util.h +++ b/util.h @@ -32,4 +32,10 @@ void dump(void* data, int length); //ULLONG htonll(ULLONG a); //ULLONG ntohll(ULLONG a); +[[deprecated]] +int min(UINT a, int b); + +[[deprecated]] +int max(int a, int b); + #endif diff --git a/wpictureview.cc b/wpictureview.cc index 54b78d4..a0c876c 100644 --- a/wpictureview.cc +++ b/wpictureview.cc @@ -15,18 +15,19 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with VOMP. If not, see . */ -#include "wpictureview.h" +#include +#include #include "colour.h" #include "input.h" #include "osd.h" #include "movieinfo.h" #include "seriesinfo.h" -#include + +#include "wpictureview.h" WPictureView::WPictureView(): foreColour(DrawStyle::LIGHTTEXT) @@ -40,8 +41,6 @@ WPictureView::~WPictureView() { } - - void WPictureView::setForegroundColour(const DrawStyle& fcolour) { foreColour = fcolour; @@ -70,7 +69,7 @@ void WPictureView::draw() { if ((((*itty).w + cur_width+ 10.f) > area.w || const_height) && cur_pict.size() > 0) break; cur_width += 10 + (*itty).w; - if (!const_height) max_height = max(max_height,(*itty).h); + if (!const_height) max_height = std::max(max_height,(*itty).h); cur_pict.push_back(&(*itty)); itty++; } -- 2.39.5