diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-25 17:07:09 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-25 17:07:09 -0500 |
commit | a56f549a266e14cdc00a98e8dc3e154f5ac6c23e (patch) | |
tree | b513d9bbf656fe1ac054e3201fe10ac94de461ef /math.c | |
parent | f6d49d377ac136fc29457b3b4501f0488b6412e3 (diff) |
error box; generally better error handling
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 30 |
1 files changed, 27 insertions, 3 deletions
@@ -46,7 +46,7 @@ static int clampi(int x, int a, int b) { return x; } -static i32 clampi32(i32 x, i32 a, i32 b) { +static i32 clamp_i32(i32 x, i32 a, i32 b) { if (x < a) return a; if (x > b) return b; return x; @@ -74,11 +74,35 @@ static double mind(double a, double b) { return a < b ? a : b; } -static u32 minu32(u32 a, u32 b) { +static u32 min_u32(u32 a, u32 b) { return a < b ? a : b; } -static u32 maxu32(u32 a, u32 b) { +static u32 max_u32(u32 a, u32 b) { + return a > b ? a : b; +} + +static i32 min_i32(i32 a, i32 b) { + return a < b ? a : b; +} + +static i32 max_i32(i32 a, i32 b) { + return a > b ? a : b; +} + +static u64 min_u64(u64 a, u64 b) { + return a < b ? a : b; +} + +static u64 max_u64(u64 a, u64 b) { + return a > b ? a : b; +} + +static i64 min_i64(i64 a, i64 b) { + return a < b ? a : b; +} + +static i64 max_i64(i64 a, i64 b) { return a > b ? a : b; } |