diff options
author | EuAndreh <eu@euandre.org> | 2024-06-25 14:06:13 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-06-25 14:06:13 -0300 |
commit | 0f8911e29bd68af82cd6403e2c081f939477e265 (patch) | |
tree | 03bdaa831b242cff411f785cde7421b51b5aeafb /src | |
parent | Fix clang warnings (diff) | |
download | pindaiba-0f8911e29bd68af82cd6403e2c081f939477e265.tar.gz pindaiba-0f8911e29bd68af82cd6403e2c081f939477e265.tar.xz |
src/math.h: Add max_size() function
Diffstat (limited to 'src')
-rw-r--r-- | src/math.c | 3 | ||||
-rw-r--r-- | src/math.h | 5 |
2 files changed, 8 insertions, 0 deletions
@@ -41,3 +41,6 @@ mul_size(const size_t x, const size_t y, size_t *const out) { out: return rc; } + +extern inline size_t +max_size(const size_t x, const size_t y); @@ -3,3 +3,8 @@ add_size(const size_t x, const size_t y, size_t *const out); int mul_size(const size_t x, const size_t y, size_t *const out); + +inline size_t +max_size(size_t x, size_t y) { + return x > y ? x : y; +} |