aboutsummaryrefslogtreecommitdiff
path: root/shared/util.c
blob: ea972b0e0b6fd87619205cbaddf73306489ebe53 (plain)
1
2
3
4
5
6
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;
}