diff options
-rw-r--r-- | lib/libsndio/aucat.c | 10 | ||||
-rw-r--r-- | lib/libsndio/mio.c | 8 | ||||
-rw-r--r-- | lib/libsndio/mio_rmidi.c | 6 | ||||
-rw-r--r-- | lib/libsndio/mio_thru.c | 8 | ||||
-rw-r--r-- | lib/libsndio/sndio.c | 18 | ||||
-rw-r--r-- | lib/libsndio/sun.c | 34 |
6 files changed, 42 insertions, 42 deletions
diff --git a/lib/libsndio/aucat.c b/lib/libsndio/aucat.c index f79f235d532..0be6544668c 100644 --- a/lib/libsndio/aucat.c +++ b/lib/libsndio/aucat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aucat.c,v 1.36 2010/04/22 17:43:30 ratchov Exp $ */ +/* $OpenBSD: aucat.c,v 1.37 2010/04/24 06:15:54 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -189,7 +189,7 @@ sio_open_aucat(const char *str, unsigned mode, int nbio) int s; char unit[4], *sep, *opt; struct aucat_hdl *hdl; - struct sockaddr_un ca; + struct sockaddr_un ca; socklen_t len = sizeof(struct sockaddr_un); uid_t uid; @@ -216,7 +216,7 @@ sio_open_aucat(const char *str, unsigned mode, int nbio) hdl = malloc(sizeof(struct aucat_hdl)); if (hdl == NULL) return NULL; - sio_create(&hdl->sio, &aucat_ops, mode, nbio); + sio_create(&hdl->sio, &aucat_ops, mode, nbio); s = socket(AF_UNIX, SOCK_STREAM, 0); if (s < 0) @@ -356,7 +356,7 @@ aucat_stop(struct sio_hdl *sh) * complete data block in progress */ if (hdl->wstate != STATE_IDLE) { - todo = (hdl->wstate == STATE_MSG) ? + todo = (hdl->wstate == STATE_MSG) ? hdl->wmsg.u.data.size : hdl->wtodo; hdl->maxwrite = todo; memset(zero, 0, ZERO_MAX); @@ -689,7 +689,7 @@ aucat_pollfd(struct sio_hdl *sh, struct pollfd *pfd, int events) if (hdl->rstate == STATE_MSG) events |= POLLIN; pfd->fd = hdl->fd; - pfd->events = events; + pfd->events = events; DPRINTF("aucat: pollfd: %x -> %x\n", hdl->events, pfd->events); return 1; } diff --git a/lib/libsndio/mio.c b/lib/libsndio/mio.c index cbeeb5d6be6..d94f32c7fbe 100644 --- a/lib/libsndio/mio.c +++ b/lib/libsndio/mio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mio.c,v 1.7 2009/08/21 16:48:03 ratchov Exp $ */ +/* $OpenBSD: mio.c,v 1.8 2010/04/24 06:15:54 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -55,7 +55,7 @@ mio_open(const char *str, unsigned mode, int nbio) if (!dbg || sscanf(dbg, "%u", &mio_debug) != 1) mio_debug = 0; } -#endif +#endif if ((mode & (MIO_OUT | MIO_IN)) == 0) return NULL; if (str == NULL && !issetugid()) @@ -72,7 +72,7 @@ mio_open(const char *str, unsigned mode, int nbio) * try legacy "/dev/rmidioxxx" device name */ if (stat(str, &sb) < 0 || !S_ISCHR(sb.st_mode)) { - DPRINTF("mio_open: %s: missing ':' separator\n", str); + DPRINTF("mio_open: %s: missing ':' separator\n", str); return NULL; } snprintf(buf, sizeof(buf), "%u", minor(sb.st_rdev)); @@ -162,7 +162,7 @@ mio_pollfd(struct mio_hdl *hdl, struct pollfd *pfd, int events) int mio_revents(struct mio_hdl *hdl, struct pollfd *pfd) -{ +{ if (hdl->eof) return POLLHUP; return hdl->ops->revents(hdl, pfd); diff --git a/lib/libsndio/mio_rmidi.c b/lib/libsndio/mio_rmidi.c index e1128f9c39a..05b11c03240 100644 --- a/lib/libsndio/mio_rmidi.c +++ b/lib/libsndio/mio_rmidi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mio_rmidi.c,v 1.5 2009/08/01 08:32:23 ratchov Exp $ */ +/* $OpenBSD: mio_rmidi.c,v 1.6 2010/04/24 06:15:54 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -65,7 +65,7 @@ mio_open_rmidi(const char *str, unsigned mode, int nbio) snprintf(path, sizeof(path), "/dev/rmidi%s", str); if (mode == (MIO_OUT | MIO_IN)) flags = O_RDWR; - else + else flags = (mode & MIO_OUT) ? O_WRONLY : O_RDONLY; if (nbio) flags |= O_NONBLOCK; @@ -149,7 +149,7 @@ rmidi_pollfd(struct mio_hdl *sh, struct pollfd *pfd, int events) struct rmidi_hdl *hdl = (struct rmidi_hdl *)sh; pfd->fd = hdl->fd; - pfd->events = events; + pfd->events = events; return 1; } diff --git a/lib/libsndio/mio_thru.c b/lib/libsndio/mio_thru.c index 1413f9ee5c2..67763ad9000 100644 --- a/lib/libsndio/mio_thru.c +++ b/lib/libsndio/mio_thru.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mio_thru.c,v 1.7 2010/04/22 17:43:30 ratchov Exp $ */ +/* $OpenBSD: mio_thru.c,v 1.8 2010/04/24 06:15:54 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -59,7 +59,7 @@ thru_open(const char *str, char *sock, unsigned mode, int nbio) int s, n, todo; unsigned char *data; struct thru_hdl *hdl; - struct sockaddr_un ca; + struct sockaddr_un ca; socklen_t len = sizeof(struct sockaddr_un); uid_t uid; @@ -73,7 +73,7 @@ thru_open(const char *str, char *sock, unsigned mode, int nbio) hdl = malloc(sizeof(struct thru_hdl)); if (hdl == NULL) return NULL; - mio_create(&hdl->mio, &thru_ops, mode, nbio); + mio_create(&hdl->mio, &thru_ops, mode, nbio); s = socket(AF_UNIX, SOCK_STREAM, 0); if (s < 0) @@ -225,7 +225,7 @@ thru_pollfd(struct mio_hdl *sh, struct pollfd *pfd, int events) struct thru_hdl *hdl = (struct thru_hdl *)sh; pfd->fd = hdl->fd; - pfd->events = events; + pfd->events = events; return 1; } diff --git a/lib/libsndio/sndio.c b/lib/libsndio/sndio.c index 57cf91e2976..8f7e4b9e08c 100644 --- a/lib/libsndio/sndio.c +++ b/lib/libsndio/sndio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sndio.c,v 1.24 2010/04/06 20:07:01 ratchov Exp $ */ +/* $OpenBSD: sndio.c,v 1.25 2010/04/24 06:15:54 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -43,7 +43,7 @@ void sio_initpar(struct sio_par *par) { memset(par, 0xff, sizeof(struct sio_par)); - par->__magic = SIO_PAR_MAGIC; + par->__magic = SIO_PAR_MAGIC; } /* @@ -85,7 +85,7 @@ sio_strtoenc(struct sio_par *par, char *istr) { char *p = istr; int i, sig, bits, le, bps, msb; - + #define IS_SEP(c) \ (((c) < 'a' || (c) > 'z') && \ ((c) < 'A' || (c) > 'Z') && \ @@ -101,7 +101,7 @@ sio_strtoenc(struct sio_par *par, char *istr) } else return 0; p++; - + /* * get number of bits per sample */ @@ -183,7 +183,7 @@ sio_open(const char *str, unsigned mode, int nbio) if (!dbg || sscanf(dbg, "%u", &sio_debug) != 1) sio_debug = 0; } -#endif +#endif if ((mode & (SIO_PLAY | SIO_REC)) == 0) return NULL; if (str == NULL && !issetugid()) @@ -460,7 +460,7 @@ sio_write(struct sio_hdl *hdl, const void *buf, size_t len) DPRINTF("%ld.%06ld: ", dtv.tv_sec, dtv.tv_usec); timersub(&tv1, &tv0, &dtv); - us = dtv.tv_sec * 1000000 + dtv.tv_usec; + us = dtv.tv_sec * 1000000 + dtv.tv_usec; DPRINTF( "sio_write: wrote %d bytes of %d in %uus\n", (int)(len - todo), (int)len, us); @@ -490,7 +490,7 @@ sio_pollfd(struct sio_hdl *hdl, struct pollfd *pfd, int events) int sio_revents(struct sio_hdl *hdl, struct pollfd *pfd) -{ +{ int revents; #ifdef DEBUG struct timeval tv0, tv1, dtv; @@ -514,7 +514,7 @@ sio_revents(struct sio_hdl *hdl, struct pollfd *pfd) DPRINTF("%ld.%06ld: ", dtv.tv_sec, dtv.tv_usec); timersub(&tv1, &tv0, &dtv); - us = dtv.tv_sec * 1000000 + dtv.tv_usec; + us = dtv.tv_sec * 1000000 + dtv.tv_usec; DPRINTF("sio_revents: revents = 0x%x, complete in %uus\n", revents, us); } @@ -595,5 +595,5 @@ void sio_onvol_cb(struct sio_hdl *hdl, unsigned ctl) { if (hdl->vol_cb) - hdl->vol_cb(hdl->vol_addr, ctl); + hdl->vol_cb(hdl->vol_addr, ctl); } diff --git a/lib/libsndio/sun.c b/lib/libsndio/sun.c index e6bde90a1a1..10ade3d1388 100644 --- a/lib/libsndio/sun.c +++ b/lib/libsndio/sun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sun.c,v 1.29 2010/04/11 16:53:55 ratchov Exp $ */ +/* $OpenBSD: sun.c,v 1.30 2010/04/24 06:15:54 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -150,11 +150,11 @@ sun_enctoinfo(struct sun_hdl *hdl, unsigned *renc, struct sio_par *par) * device can use them; return 1 on success, 0 on failure or error */ static int -sun_tryinfo(struct sun_hdl *hdl, struct sio_enc *enc, +sun_tryinfo(struct sun_hdl *hdl, struct sio_enc *enc, unsigned pchan, unsigned rchan, unsigned rate) { - struct audio_info aui; - + struct audio_info aui; + AUDIO_INITINFO(&aui); if (enc) { if (enc->le && enc->sig) { @@ -217,10 +217,10 @@ sun_getcap(struct sio_hdl *sh, struct sio_cap *cap) { #define NCHANS (sizeof(chans) / sizeof(chans[0])) #define NRATES (sizeof(rates) / sizeof(rates[0])) - static unsigned chans[] = { + static unsigned chans[] = { 1, 2, 4, 6, 8, 10, 12 }; - static unsigned rates[] = { + static unsigned rates[] = { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000 }; @@ -297,7 +297,7 @@ sun_getcap(struct sio_hdl *sh, struct sio_cap *cap) rchan_map |= (1 << i); } } - + /* * fill rates * @@ -349,7 +349,7 @@ struct sio_hdl * sio_open_sun(const char *str, unsigned mode, int nbio) { int fd, flags, fullduplex; - struct audio_info aui; + struct audio_info aui; struct sun_hdl *hdl; struct sio_par par; char path[PATH_MAX]; @@ -362,7 +362,7 @@ sio_open_sun(const char *str, unsigned mode, int nbio) snprintf(path, sizeof(path), "/dev/audio%s", str); if (mode == (SIO_PLAY | SIO_REC)) flags = O_RDWR; - else + else flags = (mode & SIO_PLAY) ? O_WRONLY : O_RDONLY; while ((fd = open(path, flags | O_NONBLOCK)) < 0) { @@ -442,7 +442,7 @@ sun_start(struct sio_hdl *sh) { struct sio_par par; struct sun_hdl *hdl = (struct sun_hdl *)sh; - struct audio_info aui; + struct audio_info aui; if (!sio_getpar(&hdl->sio, &par)) return 0; @@ -457,7 +457,7 @@ sun_start(struct sio_hdl *sh) hdl->odelta = 0; if (hdl->sio.mode & SIO_PLAY) { - /* + /* * pause the device and let sun_write() trigger the * start later, to avoid buffer underruns */ @@ -496,7 +496,7 @@ static int sun_stop(struct sio_hdl *sh) { struct sun_hdl *hdl = (struct sun_hdl *)sh; - struct audio_info aui; + struct audio_info aui; int mode; if (ioctl(hdl->fd, AUDIO_GETINFO, &aui) < 0) { @@ -614,7 +614,7 @@ sun_setpar(struct sio_hdl *sh, struct sio_par *par) /* * if block size and buffer size are not both set then * set the blocksize to half the buffer size - */ + */ bufsz = par->appbufsz; round = par->round; if (bufsz != ~0U) { @@ -695,7 +695,7 @@ static int sun_getpar(struct sio_hdl *sh, struct sio_par *par) { struct sun_hdl *hdl = (struct sun_hdl *)sh; - struct audio_info aui; + struct audio_info aui; if (ioctl(hdl->fd, AUDIO_GETINFO, &aui) < 0) { DPERROR("sun_getpar: getinfo"); @@ -775,9 +775,9 @@ sun_read(struct sio_hdl *sh, void *buf, size_t len) static size_t sun_autostart(struct sun_hdl *hdl) { - struct audio_info aui; + struct audio_info aui; struct pollfd pfd; - + pfd.fd = hdl->fd; pfd.events = POLLOUT; while (poll(&pfd, 1, 0) < 0) { @@ -856,7 +856,7 @@ sun_pollfd(struct sio_hdl *sh, struct pollfd *pfd, int events) struct sun_hdl *hdl = (struct sun_hdl *)sh; pfd->fd = hdl->fd; - pfd->events = events; + pfd->events = events; return 1; } |