summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/core-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore/core-util.h')
-rw-r--r--src/pulsecore/core-util.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h
index 49315b55..e9313d4b 100644
--- a/src/pulsecore/core-util.h
+++ b/src/pulsecore/core-util.h
@@ -155,6 +155,17 @@ static inline unsigned pa_make_power_of_two(unsigned n) {
return n + 1;
}
+static inline unsigned pa_ulog2(unsigned n) {
+ unsigned r = 0;
+
+ while (n) {
+ r++;
+ n = n >> 1;
+ }
+
+ return r;
+}
+
void pa_close_pipe(int fds[2]);
char *pa_readlink(const char *p);