[pulseaudio-commits] r2424 - /branches/glitch-free/src/pulsecore/core-util.h
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Thu May 15 10:58:12 PDT 2008
Author: lennart
Date: Thu May 15 19:58:11 2008
New Revision: 2424
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2424&root=pulseaudio&view=rev
Log:
add pa_ulog2()
Modified:
branches/glitch-free/src/pulsecore/core-util.h
Modified: branches/glitch-free/src/pulsecore/core-util.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/pulsecore/core-util.h?rev=2424&root=pulseaudio&r1=2423&r2=2424&view=diff
==============================================================================
--- branches/glitch-free/src/pulsecore/core-util.h (original)
+++ branches/glitch-free/src/pulsecore/core-util.h Thu May 15 19:58:11 2008
@@ -155,6 +155,17 @@
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);
More information about the pulseaudio-commits
mailing list