diff options
author | 2016-07-31 11:50:20 +0200 | |
---|---|---|
committer | 2016-07-31 14:41:02 +0200 | |
commit | 9667c6a8cce1829a7321dde67bd0287c73234386 (patch) | |
tree | f3665957d557cb18728a40e75f7d9f2341aaff1d /src/lib/util/palette.cpp | |
parent | 69ac4affc86caac51ff9720083ed128dabdb932f (diff) |
std::min and std:max instead of MIN and MAX, also some more macros converted to inline functions (nw)
Diffstat (limited to 'src/lib/util/palette.cpp')
-rw-r--r-- | src/lib/util/palette.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/util/palette.cpp b/src/lib/util/palette.cpp index 5fe68973c4b..bbee6b321cd 100644 --- a/src/lib/util/palette.cpp +++ b/src/lib/util/palette.cpp @@ -13,6 +13,7 @@ #include "palette.h" #include <stdlib.h> #include <math.h> +#include <algorithm> //************************************************************************** @@ -107,8 +108,8 @@ void palette_client::dirty_state::resize(UINT32 colors) void palette_client::dirty_state::mark_dirty(UINT32 index) { m_dirty[index / 32] |= 1 << (index % 32); - m_mindirty = MIN(m_mindirty, index); - m_maxdirty = MAX(m_maxdirty, index); + m_mindirty = std::min(m_mindirty, index); + m_maxdirty = std::max(m_maxdirty, index); } @@ -504,8 +505,8 @@ void palette_t::group_set_contrast(UINT32 group, float contrast) void palette_t::normalize_range(UINT32 start, UINT32 end, int lum_min, int lum_max) { // clamp within range - start = MAX(start, 0); - end = MIN(end, m_numcolors - 1); + start = std::max(start, 0U); + end = std::min(end, m_numcolors - 1); // find the minimum and maximum brightness of all the colors in the range INT32 ymin = 1000 * 255, ymax = 0; @@ -513,8 +514,8 @@ void palette_t::normalize_range(UINT32 start, UINT32 end, int lum_min, int lum_m { rgb_t rgb = m_entry_color[index]; UINT32 y = 299 * rgb.r() + 587 * rgb.g() + 114 * rgb.b(); - ymin = MIN(ymin, y); - ymax = MAX(ymax, y); + ymin = std::min(ymin, INT32(y)); + ymax = std::max(ymax, INT32(y)); } // determine target minimum/maximum |