Replace SET_MIN with std::min

This commit is contained in:
GravisZro 2024-05-21 06:27:01 -04:00
parent 76e86fed8c
commit 88d1dfa948
3 changed files with 10 additions and 9 deletions

View File

@ -85,6 +85,8 @@
* $NoKeywords: $ * $NoKeywords: $
*/ */
#include <algorithm>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
@ -640,8 +642,8 @@ void grSurface::xlat16_24(char *data, int w, int h) {
dptr = (char *)m_DataPtr; dptr = (char *)m_DataPtr;
sptr = (uint16_t *)data; sptr = (uint16_t *)data;
height = SET_MIN(h, ddsfObj.h); height = std::min(h, ddsfObj.h);
width = SET_MIN(w, ddsfObj.w); width = std::min(w, ddsfObj.w);
for (row = 0; row < height; row++) { for (row = 0; row < height; row++) {
dcol = 0; dcol = 0;
@ -705,8 +707,8 @@ void grSurface::xlat32_16(char *data, int w, int h) {
dptr = (uint16_t *)m_DataPtr; dptr = (uint16_t *)m_DataPtr;
sptr = (unsigned *)data; sptr = (unsigned *)data;
rowsize_w = m_DataRowsize / 2; rowsize_w = m_DataRowsize / 2;
height = SET_MIN(h, ddsfObj.h); height = std::min(h, ddsfObj.h);
width = SET_MIN(w, ddsfObj.w); width = std::min(w, ddsfObj.w);
for (row = 0; row < height; row++) { for (row = 0; row < height; row++) {
for (col = 0; col < width; col++) { for (col = 0; col < width; col++) {

View File

@ -959,8 +959,8 @@ void grfont_XlateColorChar(int bmp_handle, int x, int y, int index, tFontFileInf
sptr = (uint16_t *)ft->char_data[index]; sptr = (uint16_t *)ft->char_data[index];
rowsize_w = bm_rowsize(bmp_handle, 0) / 2; rowsize_w = bm_rowsize(bmp_handle, 0) / 2;
// height = SET_MIN(h, ddsfObj.h); // height = std::min(h, ddsfObj.h);
// width = SET_MIN(w, ddsfObj.w); // width = std::min(w, ddsfObj.w);
dptr = dptr + (y * rowsize_w); dptr = dptr + (y * rowsize_w);
if (ft->flags & FT_FMT4444) { if (ft->flags & FT_FMT4444) {
@ -999,8 +999,8 @@ void grfont_XlateColorGrayChar(int bmp_handle, int x, int y, int index, tFontFil
sptr = (uint16_t *)ft->char_data[index]; sptr = (uint16_t *)ft->char_data[index];
rowsize_w = bm_rowsize(bmp_handle, 0) / 2; rowsize_w = bm_rowsize(bmp_handle, 0) / 2;
// height = SET_MIN(h, ddsfObj.h); // height = std::min(h, ddsfObj.h);
// width = SET_MIN(w, ddsfObj.w); // width = std::min(w, ddsfObj.w);
dptr = dptr + (y * rowsize_w); dptr = dptr + (y * rowsize_w);
float recip32 = 1.0f / 32.0f; float recip32 = 1.0f / 32.0f;

View File

@ -66,7 +66,6 @@
(a) = (b); \ (a) = (b); \
(b) = _swap_var_; \ (b) = _swap_var_; \
} while (0) } while (0)
#define SET_MIN(a, b) (((a) < (b)) ? (a) : (b))
#define CHECK_FLAG(_var, _flag) ((_var) & (_flag)) #define CHECK_FLAG(_var, _flag) ((_var) & (_flag))
#define makeword(_h, _l) (((_h) << 16) + ((_l) & 0xffff)) #define makeword(_h, _l) (((_h) << 16) + ((_l) & 0xffff))
#define hiword(_v) ((_v) >> 16) #define hiword(_v) ((_v) >> 16)