Switch uses of MIN() to SDL_min() We're excluding files in src/hidapi to minimize the diff against the upstream project.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
diff --git a/src/render/software/SDL_rotate.c b/src/render/software/SDL_rotate.c
index 6a9efac..d5ffc14 100644
--- a/src/render/software/SDL_rotate.c
+++ b/src/render/software/SDL_rotate.c
@@ -62,11 +62,6 @@ typedef struct tColorY {
} tColorY;
/* !
-\brief Returns maximum of two numbers a and b.
-*/
-#define MAX(a,b) (((a) > (b)) ? (a) : (b))
-
-/* !
\brief Number of guard rows added to destination surfaces.
This is a simple but effective workaround for observed issues.
diff --git a/src/render/software/SDL_rotate.h b/src/render/software/SDL_rotate.h
index 171baa5..8d7ec9d 100644
--- a/src/render/software/SDL_rotate.h
+++ b/src/render/software/SDL_rotate.h
@@ -22,10 +22,6 @@
#ifndef SDL_rotate_h_
#define SDL_rotate_h_
-#ifndef MIN
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
-#endif
-
extern SDL_Surface *SDLgfx_rotateSurface(SDL_Surface * src, double angle, int smooth, int flipx, int flipy,
const SDL_Rect *rect_dest, double cangle, double sangle, const SDL_FPoint *center);
extern void SDLgfx_rotozoomSurfaceSizeTrig(int width, int height, double angle, const SDL_FPoint *center,
diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c
index 983c9d9..e8b05ec 100644
--- a/src/video/SDL_RLEaccel.c
+++ b/src/video/SDL_RLEaccel.c
@@ -92,10 +92,6 @@
#include "SDL_blit.h"
#include "SDL_RLEaccel_c.h"
-#ifndef MIN
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
#define PIXEL_COPY(to, from, len, bpp) \
SDL_memcpy(to, from, (size_t)(len) * (bpp))
@@ -1161,13 +1157,13 @@ RLEAlphaSurface(SDL_Surface * surface)
ADD_OPAQUE_COUNTS(max_opaque_run, 0);
skip -= max_opaque_run;
}
- len = MIN(run, max_opaque_run);
+ len = SDL_min(run, max_opaque_run);
ADD_OPAQUE_COUNTS(skip, len);
dst += copy_opaque(dst, src + runstart, len, sf, df);
runstart += len;
run -= len;
while (run) {
- len = MIN(run, max_opaque_run);
+ len = SDL_min(run, max_opaque_run);
ADD_OPAQUE_COUNTS(0, len);
dst += copy_opaque(dst, src + runstart, len, sf, df);
runstart += len;
@@ -1195,13 +1191,13 @@ RLEAlphaSurface(SDL_Surface * surface)
ADD_TRANSL_COUNTS(max_transl_run, 0);
skip -= max_transl_run;
}
- len = MIN(run, max_transl_run);
+ len = SDL_min(run, max_transl_run);
ADD_TRANSL_COUNTS(skip, len);
dst += copy_transl(dst, src + runstart, len, sf, df);
runstart += len;
run -= len;
while (run) {
- len = MIN(run, max_transl_run);
+ len = SDL_min(run, max_transl_run);
ADD_TRANSL_COUNTS(0, len);
dst += copy_transl(dst, src + runstart, len, sf, df);
runstart += len;
@@ -1359,14 +1355,14 @@ RLEColorkeySurface(SDL_Surface * surface)
ADD_COUNTS(maxn, 0);
skip -= maxn;
}
- len = MIN(run, maxn);
+ len = SDL_min(run, maxn);
ADD_COUNTS(skip, len);
SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp);
dst += len * bpp;
run -= len;
runstart += len;
while (run) {
- len = MIN(run, maxn);
+ len = SDL_min(run, maxn);
ADD_COUNTS(0, len);
SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp);
dst += len * bpp;
diff --git a/src/video/uikit/SDL_uikitopenglview.m b/src/video/uikit/SDL_uikitopenglview.m
index 52158f8..ef5ca74 100644
--- a/src/video/uikit/SDL_uikitopenglview.m
+++ b/src/video/uikit/SDL_uikitopenglview.m
@@ -89,7 +89,7 @@
glGetIntegerv(GL_MAX_SAMPLES, &maxsamples);
/* Clamp the samples to the max supported count. */
- samples = MIN(samples, maxsamples);
+ samples = SDL_min(samples, maxsamples);
}
if (sRGB) {