summaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index 925841c5..a5815018 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -100,3 +100,8 @@ void xstrunescape(const char *in, char *out)
}
out[k++] = '\0';
}
+
+int round_pow_2(unsigned int n)
+{
+ return 1UL << fls(n - 1);
+}