aboutsummaryrefslogtreecommitdiff
path: root/shared/util.c
diff options
context:
space:
mode:
authorUnavailableDev <69792062+UnavailableDev@users.noreply.github.com>2022-10-30 10:57:11 +0100
committerUnavailableDev <69792062+UnavailableDev@users.noreply.github.com>2022-10-30 10:57:50 +0100
commit8952e19f00e0930e53e3731fd30be5e2600d9fd6 (patch)
tree2770bfd4319402c88b6872d1f8699252329c6603 /shared/util.c
parent6d9df6fe97502a852b68c8c8e6781d7208170cae (diff)
parent60f954dbaa399f8f0bcaeeb307953fc3b37b9dc7 (diff)
finish merge
Diffstat (limited to 'shared/util.c')
-rw-r--r--shared/util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/shared/util.c b/shared/util.c
new file mode 100644
index 0000000..ea972b0
--- /dev/null
+++ b/shared/util.c
@@ -0,0 +1,7 @@
+#include "util.h"
+
+unsigned int ws_log16(unsigned int x) {
+ unsigned int l = 0;
+ while (x >>= 4) ++l; // bitshift right by 4 until x == 0
+ return l;
+} \ No newline at end of file