projects
/
platform
/
upstream
/
pulseaudio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
103ceaa
)
add pa_ulog2()
author
Lennart Poettering
<lennart@poettering.net>
Thu, 15 May 2008 17:58:11 +0000
(17:58 +0000)
committer
Lennart Poettering
<lennart@poettering.net>
Thu, 15 May 2008 17:58:11 +0000
(17:58 +0000)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2424
fefdeb5f
-60dc-0310-8127-
8f9354f1896f
src/pulsecore/core-util.h
patch
|
blob
|
history
diff --git
a/src/pulsecore/core-util.h
b/src/pulsecore/core-util.h
index
49315b5
..
e9313d4
100644
(file)
--- 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);