]> git.vomp.tv Git - vompclient.git/commitdiff
Move min & max to Util and deprecate
authorChris Tallon <chris@vomp.tv>
Fri, 22 May 2020 15:51:14 +0000 (16:51 +0100)
committerChris Tallon <chris@vomp.tv>
Fri, 22 May 2020 15:51:14 +0000 (16:51 +0100)
main.cc
util.cc
util.h
wpictureview.cc

diff --git a/main.cc b/main.cc
index de56e17ef43975f1f6ae3190de8e3d66873b3773..506f7fe97e211b2a9d3dbeb988de6bec944baf72 100644 (file)
--- 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 8d5320879f8e1a529e801e9ae5e01be839a5de6c..e0b762e7df081c890d6e271013bcbe93c8119628 100644 (file)
--- 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 b4a9153c505920395cb7366871dc4c1152d5860d..25be8ad954069f2f8cd495291eb34af24bee34d5 100644 (file)
--- 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
index 54b78d40a7d66ac2866884b7b20947ba70d47a9c..a0c876cabe81afba9c45efaf884b823a467d0c55 100644 (file)
     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 <https://www.gnu.org/licenses/>.
 */
 
-#include "wpictureview.h"
+#include <math.h>
+#include <algorithm>
 
 #include "colour.h"
 #include "input.h"
 #include "osd.h"
 #include "movieinfo.h"
 #include "seriesinfo.h"
-#include <math.h>
+
+#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++;
          }