diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-10-28 09:57:50 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-10-28 09:57:50 +0200 |
commit | 1cac46e7701ef2783aea13d55261582f4d91f2fa (patch) | |
tree | abcd22854d5a9c5303cccc5ba1ccca73e7b8bbbf /shared/util.c | |
parent | 89e652af2506f7cf7854ce2e6f5b9b97423d1d40 (diff) |
working janky protocol!
Diffstat (limited to 'shared/util.c')
-rw-r--r-- | shared/util.c | 7 |
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 |