mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-01-11 10:15:30 +00:00
Switch uses of MIN() to SDL_min()
We're excluding files in src/hidapi to minimize the diff against the upstream project.
This commit is contained in:
parent
ca26df3404
commit
6c2928b4be
|
@ -61,11 +61,6 @@ typedef struct tColorY {
|
|||
Uint8 y;
|
||||
} 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.
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue