From 1e59dd91fcddd3c4727d8e9aa5238438917269f9 Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Fri, 30 Sep 2022 14:49:03 +0300 Subject: [PATCH] algorithm.hpp header fixes Former-commit-id: 675a1904c4496aa699578969eef6d7429bfb43c8 --- include/rstl/algorithm.hpp | 14 +++----------- include/rstl/math.hpp | 9 +++++---- src/Kyoto/Graphics/DolphinCColor.cpp | 2 +- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/include/rstl/algorithm.hpp b/include/rstl/algorithm.hpp index 39e813c6..c38443cb 100644 --- a/include/rstl/algorithm.hpp +++ b/include/rstl/algorithm.hpp @@ -1,18 +1,10 @@ -#ifndef _RSTL_MATH_HPP -#define _RSTL_MATH_HPP +#ifndef _RSTL_ALGORITHM_HPP +#define _RSTL_ALGORITHM_HPP #include "rstl/pointer_iterator.hpp" namespace rstl { template < typename T > -inline const T& min_val(const T& a, const T& b) { - return (b < a) ? b : a; -} - -template < typename T > -inline const T& max_val(const T& a, const T& b) { - return (a < b) ? b : a; -} template < class Iter, class T > inline Iter find(Iter first, Iter last, const T& val) { @@ -21,4 +13,4 @@ inline Iter find(Iter first, Iter last, const T& val) { return first; } } // namespace rstl -#endif // _RSTL_MATH_HPP +#endif // _RSTL_ALGORITHM_HPP diff --git a/include/rstl/math.hpp b/include/rstl/math.hpp index 8ffbce06..dd6f4a16 100644 --- a/include/rstl/math.hpp +++ b/include/rstl/math.hpp @@ -5,12 +5,13 @@ namespace rstl { template < typename T > -static inline const T& max_val(const T& a, const T& b) { - return a > b ? a : b; +inline const T& min_val(const T& a, const T& b) { + return (b < a) ? b : a; } + template < typename T > -static inline const T& min_val(const T& a, const T& b) { - return a < b ? a : b; +inline const T& max_val(const T& a, const T& b) { + return (a < b) ? b : a; } } // namespace rstl diff --git a/src/Kyoto/Graphics/DolphinCColor.cpp b/src/Kyoto/Graphics/DolphinCColor.cpp index 3c9f094b..5e7e36d5 100644 --- a/src/Kyoto/Graphics/DolphinCColor.cpp +++ b/src/Kyoto/Graphics/DolphinCColor.cpp @@ -2,7 +2,7 @@ #include "Kyoto/Streams/CInputStream.hpp" -#include "rstl/algorithm.hpp" +#include "rstl/math.hpp" CColor::CColor(CInputStream& in) { float r = in.ReadFloat();