Source-Changes-HG archive

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

[src/trunk]: src/sys/dev The audio module will now compile with WARNS=5.



details:   https://anonhg.NetBSD.org/src/rev/b1e46ac1063d
branches:  trunk
changeset: 355473:b1e46ac1063d
user:      nat <nat%NetBSD.org@localhost>
date:      Sun Jul 30 00:47:48 2017 +0000

description:
The audio module will now compile with WARNS=5.

diffstat:

 sys/dev/auconv.c     |   6 +++---
 sys/dev/audio.c      |  22 ++++++++++++----------
 sys/dev/audiovar.h   |   6 +++---
 sys/dev/aurateconv.c |  16 ++++++++--------
 4 files changed, 26 insertions(+), 24 deletions(-)

diffs (202 lines):

diff -r 89366305128d -r b1e46ac1063d sys/dev/auconv.c
--- a/sys/dev/auconv.c  Sat Jul 29 23:10:36 2017 +0000
+++ b/sys/dev/auconv.c  Sun Jul 30 00:47:48 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auconv.c,v 1.30 2017/07/28 01:36:40 nat Exp $  */
+/*     $NetBSD: auconv.c,v 1.31 2017/07/30 00:47:48 nat Exp $  */
 
 /*
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.30 2017/07/28 01:36:40 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.31 2017/07/30 00:47:48 nat Exp $");
 
 #include <sys/types.h>
 #include <sys/audioio.h>
@@ -928,7 +928,7 @@
                        if (formats[i].frequency[1] > maxrate)
                                maxrate = formats[i].frequency[1];
                } else {
-                       for (j = 0; j < formats[i].frequency_type; j++) {
+                       for (j = 0; j < (int)formats[i].frequency_type; j++) {
                                if (formats[i].frequency[j] < minrate)
                                        minrate = formats[i].frequency[j];
                                if (formats[i].frequency[j] > maxrate)
diff -r 89366305128d -r b1e46ac1063d sys/dev/audio.c
--- a/sys/dev/audio.c   Sat Jul 29 23:10:36 2017 +0000
+++ b/sys/dev/audio.c   Sun Jul 30 00:47:48 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.382 2017/07/29 06:45:35 isaki Exp $        */
+/*     $NetBSD: audio.c,v 1.383 2017/07/30 00:47:48 nat Exp $  */
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -148,7 +148,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.382 2017/07/29 06:45:35 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.383 2017/07/30 00:47:48 nat Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -206,7 +206,7 @@
 #endif
 
 #define ROUNDSIZE(x)   (x) &= -16      /* round to nice boundary */
-#define SPECIFIED(x)   ((x) != ~0)
+#define SPECIFIED(x)   ((int)(x) != ~0)
 #define SPECIFIED_CH(x)        ((x) != (u_char)~0)
 
 /* #define AUDIO_PM_IDLE */
@@ -1986,7 +1986,7 @@
        blksize = rp->blksize;
        if (blksize < AUMINBLK)
                blksize = AUMINBLK;
-       if (blksize > rp->s.bufsize / AUMINNOBLK)
+       if (blksize > (int)(rp->s.bufsize / AUMINNOBLK))
                blksize = rp->s.bufsize / AUMINNOBLK;
        ROUNDSIZE(blksize);
        DPRINTF(("audio_init_ringbuffer: MI blksize=%d\n", blksize));
@@ -2348,8 +2348,8 @@
 {
        struct audio_ringbuffer *cb;
        struct virtual_channel *vc;
-       int error, drops;
-       int cc, i, used;
+       int error, cc, i, used;
+       uint drops;
        bool hw = false;
 
        KASSERT(mutex_owned(sc->sc_lock));
@@ -2537,7 +2537,8 @@
        struct audio_ringbuffer *cb;
        const uint8_t *outp;
        uint8_t *inp;
-       int error, used, cc, n;
+       int error, used, n;
+       uint cc;
 
        KASSERT(mutex_owned(sc->sc_lock));
 
@@ -3445,7 +3446,7 @@
        cb = &vc->sc_mpr;
 #endif
 
-       if (len > cb->s.bufsize || *offp > cb->s.bufsize - len)
+       if (len > cb->s.bufsize || *offp > (uint)(cb->s.bufsize - len))
                return EOVERFLOW;
 
        if (!cb->mmapped) {
@@ -4524,7 +4525,7 @@
        int setmode;
        int error;
        int np, nr;
-       unsigned int blks;
+       int blks;
        u_int gain;
        bool rbus, pbus;
        bool cleared, modechange, pausechange;
@@ -6063,7 +6064,8 @@
 {
        struct audio_chan *chan;
        struct virtual_channel *vc;
-       int error, i, j, k;
+       uint i, j, k;
+       int error;
 
        chan = SIMPLEQ_FIRST(&sc->sc_audiochan);
        vc = chan->vc;
diff -r 89366305128d -r b1e46ac1063d sys/dev/audiovar.h
--- a/sys/dev/audiovar.h        Sat Jul 29 23:10:36 2017 +0000
+++ b/sys/dev/audiovar.h        Sun Jul 30 00:47:48 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audiovar.h,v 1.59 2017/07/29 03:05:51 isaki Exp $      */
+/*     $NetBSD: audiovar.h,v 1.60 2017/07/30 00:47:48 nat Exp $        */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -164,8 +164,8 @@
        bool    isenum;         /* selector is enum type */
        u_int   allports;       /* all aumasks or'd */
        u_int   aumask[AUDIO_N_PORTS];  /* exposed value of "ports" */
-       u_int   misel [AUDIO_N_PORTS];  /* ord of port, for selector */
-       u_int   miport[AUDIO_N_PORTS];  /* index of port's mixerctl */
+       int     misel [AUDIO_N_PORTS];  /* ord of port, for selector */
+       int     miport[AUDIO_N_PORTS];  /* index of port's mixerctl */
        bool    isdual;         /* has working mixerout */
        int     mixerout;       /* ord of mixerout, for dual case */
        int     cur_port;       /* the port that gain actually controls when
diff -r 89366305128d -r b1e46ac1063d sys/dev/aurateconv.c
--- a/sys/dev/aurateconv.c      Sat Jul 29 23:10:36 2017 +0000
+++ b/sys/dev/aurateconv.c      Sun Jul 30 00:47:48 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aurateconv.c,v 1.20 2017/06/20 07:13:09 nat Exp $      */
+/*     $NetBSD: aurateconv.c,v 1.21 2017/07/30 00:47:48 nat Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aurateconv.c,v 1.20 2017/06/20 07:13:09 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aurateconv.c,v 1.21 2017/07/30 00:47:48 nat Exp $");
 
 #include <sys/systm.h>
 #include <sys/types.h>
@@ -293,7 +293,7 @@
 #define READ_Sn(BITS, EN, V, STREAM, RP, PAR)  \
        do { \
                int j; \
-               for (j = 0; j < (PAR)->channels; j++) { \
+               for (j = 0; j < (int)(PAR)->channels; j++) { \
                        (V)[j] = READ_S##BITS##EN(RP); \
                        RP = audio_stream_add_outp(STREAM, RP, (BITS) / NBBY); \
                } \
@@ -305,7 +305,7 @@
                        WP = audio_stream_add_inp(STREAM, WP, (BITS) / NBBY); \
                } else if (from->channels <= to->channels) { \
                        int j; \
-                       for (j = 0; j < (FROM)->channels; j++) { \
+                       for (j = 0; j < (int)(FROM)->channels; j++) { \
                                WRITE_S##BITS##EN(WP, (V)[j]); \
                                WP = audio_stream_add_inp(STREAM, WP, (BITS) / NBBY); \
                        } \
@@ -314,13 +314,13 @@
                                WP = audio_stream_add_inp(STREAM, WP, (BITS) / NBBY); \
                                j++; \
                        } \
-                       for (; j < (TO)->channels; j++) { \
+                       for (; j < (int)(TO)->channels; j++) { \
                                WRITE_S##BITS##EN(WP, 0); \
                                WP = audio_stream_add_inp(STREAM, WP, (BITS) / NBBY); \
                        } \
                } else {        /* from->channels < to->channels */ \
                        int j; \
-                       for (j = 0; j < (TO)->channels; j++) { \
+                       for (j = 0; j < (int)(TO)->channels; j++) { \
                                WRITE_S##BITS##EN(WP, (V)[j]); \
                                WP = audio_stream_add_inp(STREAM, WP, (BITS) / NBBY); \
                        } \
@@ -381,7 +381,7 @@
                                READ_Sn(BITS, EN, next, src, r, from); \
                        } \
                        c256 = this->count * 256 / to->sample_rate; \
-                       for (i = 0; i < from->channels; i++) \
+                       for (i = 0; i < (int)from->channels; i++) \
                                v[i] = (c256 * next[i] + (256 - c256) * prev[i]) >> 8; \
                        WRITE_Sn(BITS, EN, v, dst, w, from, to); \
                        this->count += from->sample_rate; \
@@ -452,7 +452,7 @@
                                used_src -= frame_src; \
                        } \
                        c256 = this->count * 256 / to->sample_rate; \
-                       for (i = 0; i < from->channels; i++) \
+                       for (i = 0; i < (int)from->channels; i++) \
                                v[i] = (int32_t)((c256 * next[i] + (INT64_C(256) - c256) * prev[i]) >> 8) & mask; \
                        WRITE_Sn(32, EN, v, dst, w, from, to); \
                        used_dst += frame_dst; \



Home | Main Index | Thread Index | Old Index