Merge pull request #129 from Makuna/ProtectFromMinMaxMacros

removed use of macro
This commit is contained in:
Michael Miller
2016-09-03 11:36:13 -07:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -208,7 +208,7 @@ public:
{ {
uint8_t* p = getPixelAddress(pPixels, indexPixel); uint8_t* p = getPixelAddress(pPixels, indexPixel);
*p++ = 0xE0 | min(color.W, 31); // upper three bits are always 111 *p++ = 0xE0 | (color.W < 31 ? color.W : 31); // upper three bits are always 111
*p++ = color.B; *p++ = color.B;
*p++ = color.G; *p++ = color.G;
*p = color.R; *p = color.R;
@@ -290,7 +290,7 @@ public:
{ {
uint8_t* p = getPixelAddress(pPixels, indexPixel); uint8_t* p = getPixelAddress(pPixels, indexPixel);
*p++ = 0xE0 | min(color.W, 31); // upper three bits are always 111 *p++ = 0xE0 | (color.W < 31 ? color.W : 31); // upper three bits are always 111
*p++ = color.G; *p++ = color.G;
*p++ = color.R; *p++ = color.R;
*p = color.B; *p = color.B;

View File

@@ -52,7 +52,7 @@ size_t HtmlColor::ToNumericalString(char* buf, size_t bufSize) const
color >>= 4; color >>= 4;
} }
buf[min(bufLen, 7)] = 0; buf[(bufLen < 7 ? bufLen : 7)] = 0;
} }
return 7; return 7;
} }