(#1010) Make extrema functions inlinable

master
rexim 2019-08-19 00:39:11 +07:00
parent fe589eb53e
commit f31fad1b98
3 changed files with 11 additions and 15 deletions

View File

@ -129,7 +129,6 @@ add_executable(nothing
src/game/sprite_font.c
src/game/sprite_font.h
src/main.c
src/math/extrema.c
src/math/extrema.h
src/math/mat3x3.c
src/math/mat3x3.h

View File

@ -1,12 +0,0 @@
#include <stdlib.h>
#include "./extrema.h"
int64_t max_int64(int64_t a, int64_t b)
{
return a > b ? a : b;
}
size_t max_size_t(size_t a, size_t b)
{
return a > b ? a : b;
}

View File

@ -6,7 +6,16 @@
// WARNING! Any attempts to "generalize" or "improve" this translation
// unit will result in an instantly closed Pull Request without any
// further discussion.
int64_t max_int64(int64_t a, int64_t b);
size_t max_size_t(size_t a, size_t b);
static inline
int64_t max_int64(int64_t a, int64_t b)
{
return a > b ? a : b;
}
static inline
size_t max_size_t(size_t a, size_t b)
{
return a > b ? a : b;
}
#endif // EXTREMA_H_