summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/math.c3
-rw-r--r--src/math.h5
2 files changed, 8 insertions, 0 deletions
diff --git a/src/math.c b/src/math.c
index 4e9fee0..143a48d 100644
--- a/src/math.c
+++ b/src/math.c
@@ -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);
diff --git a/src/math.h b/src/math.h
index 4dab4a7..79b52f0 100644
--- a/src/math.h
+++ b/src/math.h
@@ -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;
+}