]> git.alsa-project.org Git - alsa-utils.git/commitdiff
aplay: Use standard endian convesions
authorTakashi Iwai <tiwai@suse.de>
Fri, 3 Jun 2011 12:35:44 +0000 (14:35 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 12 Sep 2012 13:49:19 +0000 (15:49 +0200)
asm/*.h stuff shouldn't be used directly from the user-space apps.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
aplay/aplay.c

index 71756524040757baff16a1044e161729126ae441..50e01ef76da6c19cfc6b03537f5ee75c5572e4b1 100644 (file)
@@ -48,7 +48,7 @@
 #include <sys/signal.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <asm/byteorder.h>
+#include <endian.h>
 #include "aconfig.h"
 #include "gettext.h"
 #include "formats.h"
@@ -1508,9 +1508,9 @@ static void compute_max_peak(u_char *data, size_t count)
                c = 0;
                while (count-- > 0) {
                        if (format_little_endian)
-                               sval = __le16_to_cpu(*valp);
+                               sval = le16toh(*valp);
                        else
-                               sval = __be16_to_cpu(*valp);
+                               sval = be16toh(*valp);
                        sval = abs(sval) ^ mask;
                        if (max_peak[c] < sval)
                                max_peak[c] = sval;
@@ -1553,9 +1553,9 @@ static void compute_max_peak(u_char *data, size_t count)
                c = 0;
                while (count-- > 0) {
                        if (format_little_endian)
-                               val = __le32_to_cpu(*valp);
+                               val = le32toh(*valp);
                        else
-                               val = __be32_to_cpu(*valp);
+                               val = be32toh(*valp);
                        val = abs(val) ^ mask;
                        if (max_peak[c] < val)
                                max_peak[c] = val;