diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-10 11:16:24 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-11 14:50:02 -0500 |
commit | 90b4b08717730733402df25190bba0cc5d2fd952 (patch) | |
tree | fe85f6fa7d8128e6195a313f428fb3bf6b446929 /math.c | |
parent | 5bffb50207f8d8ba873f4c40dde4859179153001 (diff) |
indent/dedent selection
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -109,6 +109,15 @@ static inline u32 max_u32(u32 a, u32 b) { return a > b ? a : b; } +// set *a to the minimum of *a and *b, and *b to the maximum +static inline void sort2_u32(u32 *a, u32 *b) { + u32 x = *a, y = *b; + if (x > y) { + *a = y; + *b = x; + } +} + static inline i32 min_i32(i32 a, i32 b) { return a < b ? a : b; } |