Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev Rectify an error in mulaw/alaw conversion to big end...



details:   https://anonhg.NetBSD.org/src/rev/40d10adad71c
branches:  trunk
changeset: 825011:40d10adad71c
user:      nat <nat%NetBSD.org@localhost>
date:      Mon Jun 26 11:45:46 2017 +0000

description:
Rectify an error in mulaw/alaw conversion to big endian.  The atf audio
test should pass on sparc again.

diffstat:

 sys/dev/mulaw.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r 647ac6fa9125 -r 40d10adad71c sys/dev/mulaw.c
--- a/sys/dev/mulaw.c   Mon Jun 26 08:01:53 2017 +0000
+++ b/sys/dev/mulaw.c   Mon Jun 26 11:45:46 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mulaw.c,v 1.30 2017/06/25 02:16:41 nat Exp $   */
+/*     $NetBSD: mulaw.c,v 1.31 2017/06/26 11:45:46 nat Exp $   */
 
 /*
  * Copyright (c) 1991-1993 Regents of the University of California.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mulaw.c,v 1.30 2017/06/25 02:16:41 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mulaw.c,v 1.31 2017/06/26 11:45:46 nat Exp $");
 
 #include <sys/types.h>
 #include <sys/systm.h>
@@ -324,7 +324,7 @@
                        j = hw - 2;                                     \
                        d[0] = mulawtolin16[s[0]][0];                   \
                        d[1] = mulawtolin16[s[0]][1];                   \
-                       while (j < hw)                                  \
+                       while (j > 0 && j < hw)                         \
                                d[j++] = 0;                             \
                } FILTER_LOOP_EPILOGUE(this->src, dst);                 \
                break;                                                  \
@@ -342,7 +342,7 @@
                        j = hw - 2;                                     \
                        d[0] = mulawtolin16[s[0]][0] ^ 0x80;            \
                        d[1] = mulawtolin16[s[0]][1];                   \
-                       while (j < hw)                                  \
+                       while (j > 0 && j < hw)                         \
                                d[j++] = 0;                             \
                } FILTER_LOOP_EPILOGUE(this->src, dst);                 \
                break;                                                  \
@@ -459,7 +459,7 @@
                        j = hw - 2;                                     \
                        d[0] = alawtolin16[s[0]][0];                    \
                        d[1] = alawtolin16[s[0]][1];                    \
-                       while (j < hw)                                  \
+                       while (j > 0 && j < hw)                         \
                                d[j++] = 0;                             \
                } FILTER_LOOP_EPILOGUE(this->src, dst);                 \
                break;                                                  \
@@ -477,7 +477,7 @@
                        j = hw - 2;                                     \
                        d[0] = alawtolin16[s[0]][0] ^ 0x80;             \
                        d[1] = alawtolin16[s[0]][1];                    \
-                       while (j < hw)                                  \
+                       while (j > 0 && j < hw)                         \
                                d[j++] = 0;                             \
                } FILTER_LOOP_EPILOGUE(this->src, dst);                 \
                break;                                                  \



Home | Main Index | Thread Index | Old Index