since you have -Werror in your CFLAGS, sndio fails a build with WARNINGS=Yes...

The following patch fixes things.
- hex constants are unsigned.
- prototypes for everything.
- don't shadow libc rindex.

Index: include/sndio.h
===================================================================
RCS file: /cvs/src/include/sndio.h,v
retrieving revision 1.7
diff -u -p -r1.7 sndio.h
--- include/sndio.h     8 Jul 2012 17:55:50 -0000       1.7
+++ include/sndio.h     20 Aug 2012 08:07:42 -0000
@@ -51,7 +51,7 @@ struct sio_par {
        unsigned int round;     /* optimal bufsz divisor */
        unsigned int appbufsz;  /* minimum buffer size */
        int __pad[3];           /* for future use */
-       int __magic;            /* for internal/debug purposes only */
+       unsigned int __magic;   /* for internal/debug purposes only */
 };
 
 /*
Index: lib/libsndio/aucat.c
===================================================================
RCS file: /cvs/src/lib/libsndio/aucat.c,v
retrieving revision 1.54
diff -u -p -r1.54 aucat.c
--- lib/libsndio/aucat.c        11 Apr 2012 06:05:43 -0000      1.54
+++ lib/libsndio/aucat.c        20 Aug 2012 08:07:42 -0000
@@ -37,6 +37,11 @@
 #include "debug.h"
 
 
+/* forward declares */
+int aucat_mkcookie(unsigned char *);
+int aucat_connect_tcp(struct aucat *, char *, unsigned int);
+int aucat_connect_un(struct aucat *, unsigned int);
+
 /*
  * read a message, return 0 if not completed
  */
Index: lib/libsndio/sio_aucat.c
===================================================================
RCS file: /cvs/src/lib/libsndio/sio_aucat.c,v
retrieving revision 1.10
diff -u -p -r1.10 sio_aucat.c
--- lib/libsndio/sio_aucat.c    11 Apr 2012 06:05:43 -0000      1.10
+++ lib/libsndio/sio_aucat.c    20 Aug 2012 08:07:42 -0000
@@ -34,7 +34,7 @@
 struct sio_aucat_hdl {
        struct sio_hdl sio;
        struct aucat aucat;
-       unsigned int rbpf, wbpf;                /* read and write 
bytes-per-frame */
+       unsigned int rbpf, wbpf;        /* read and write bytes-per-frame */
        int maxwrite;                   /* latency constraint */
        int events;                     /* events the user requested */
        unsigned int curvol, reqvol;    /* current and requested volume */
@@ -327,7 +327,7 @@ sio_aucat_getpar(struct sio_hdl *sh, str
 static int
 sio_aucat_getcap(struct sio_hdl *sh, struct sio_cap *cap)
 {
-       unsigned int i, bps, le, sig, chan, rindex, rmult;
+       unsigned int i, bps, le, sig, chan, ridx, rmult;
        static unsigned int rates[] = { 8000, 11025, 12000 };
 
        bps = 1;
@@ -380,17 +380,17 @@ sio_aucat_getcap(struct sio_hdl *sh, str
                } else
                        chan++;
        }
-       rindex = 0;
+       ridx = 0;
        rmult = 1;
        cap->confs[0].rate = 0;
        for (i = 0; i < SIO_NRATE; i++) {
                if (rmult >= 32)
                        break;
-               cap->rate[i] = rates[rindex] * rmult;
+               cap->rate[i] = rates[ridx] * rmult;
                cap->confs[0].rate |= 1 << i;
-               rindex++;
-               if (rindex == sizeof(rates) / sizeof(unsigned int)) {
-                       rindex = 0;
+               ridx++;
+               if (ridx == sizeof(rates) / sizeof(unsigned int)) {
+                       ridx = 0;
                        rmult *= 2;
                }
        }
@@ -420,9 +420,9 @@ sio_aucat_write(struct sio_hdl *sh, cons
                if (!sio_aucat_buildmsg(hdl))
                        break;
        }
-       if (len <= 0 || hdl->maxwrite <= 0)
+       if (len == 0 || hdl->maxwrite <= 0)
                return 0;
-       if (len > hdl->maxwrite)
+       if (len > (size_t)hdl->maxwrite)
                len = hdl->maxwrite;
        n = aucat_wdata(&hdl->aucat, buf, len, hdl->wbpf, &hdl->sio.eof);
        hdl->maxwrite -= n;

Reply via email to