[pulseaudio-commits] r1698 - in /branches/lennart/src/pulsecore: core-util.c core-util.h

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Wed Aug 22 10:05:41 PDT 2007


Author: lennart
Date: Wed Aug 22 19:05:41 2007
New Revision: 1698

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1698&root=3Dpulseaudio&vi=
ew=3Drev
Log:
make pa_make_power_of_two() and pa_is_power_of_two() inline functions

Modified:
    branches/lennart/src/pulsecore/core-util.c
    branches/lennart/src/pulsecore/core-util.h

Modified: branches/lennart/src/pulsecore/core-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
core-util.c?rev=3D1698&root=3Dpulseaudio&r1=3D1697&r2=3D1698&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/core-util.c (original)
+++ branches/lennart/src/pulsecore/core-util.c Wed Aug 22 19:05:41 2007
@@ -1208,21 +1208,3 @@
     =

     return c;
 }
-
-int pa_is_power_of_two(unsigned n) {
-    return !(n & (n - 1));
-}
-
-unsigned pa_make_power_of_two(unsigned n) {
-    unsigned j =3D n;
-
-    if (pa_is_power_of_two(n))
-        return n;
-    =

-    while (j) {
-        j =3D j >> 1;
-        n =3D n | j;
-    }
-
-    return n + 1;
-}

Modified: branches/lennart/src/pulsecore/core-util.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
core-util.h?rev=3D1698&root=3Dpulseaudio&r1=3D1697&r2=3D1698&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/core-util.h (original)
+++ branches/lennart/src/pulsecore/core-util.h Wed Aug 22 19:05:41 2007
@@ -97,7 +97,22 @@
 =

 char *pa_truncate_utf8(char *c, size_t l);
 =

-int pa_is_power_of_two(unsigned n);
-unsigned pa_make_power_of_two(unsigned n);
+static inline int pa_is_power_of_two(unsigned n) {
+    return !(n & (n - 1));
+}
+
+static inline unsigned pa_make_power_of_two(unsigned n) {
+    unsigned j =3D n;
+
+    if (pa_is_power_of_two(n))
+        return n;
+    =

+    while (j) {
+        j =3D j >> 1;
+        n =3D n | j;
+    }
+
+    return n + 1;
+}
 =

 #endif




More information about the pulseaudio-commits mailing list