summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2009-01-23 17:38:15 +0000
committerratchov <ratchov@openbsd.org>2009-01-23 17:38:15 +0000
commit8350b6e6d2d17cf8871b8825a54a1926b802334d (patch)
tree77ac40593a23ae90aff80121c2b20eff448e8680
parentprefer CTR modes and revised arcfour (i.e w/ discard) modes to CBC (diff)
downloadwireguard-openbsd-8350b6e6d2d17cf8871b8825a54a1926b802334d.tar.xz
wireguard-openbsd-8350b6e6d2d17cf8871b8825a54a1926b802334d.zip
spacing + typo fix from Matt Jibson <matt.jibson(at)gmail.com>
-rw-r--r--usr.bin/aucat/abuf.c12
-rw-r--r--usr.bin/aucat/abuf.h8
-rw-r--r--usr.bin/aucat/amsg.h4
-rw-r--r--usr.bin/aucat/aparams.c8
-rw-r--r--usr.bin/aucat/aproc.c26
-rw-r--r--usr.bin/aucat/aproc.h4
-rw-r--r--usr.bin/aucat/aucat.c14
-rw-r--r--usr.bin/aucat/dev.c24
-rw-r--r--usr.bin/aucat/file.c4
-rw-r--r--usr.bin/aucat/file.h4
-rw-r--r--usr.bin/aucat/headers.c6
-rw-r--r--usr.bin/aucat/listen.c6
-rw-r--r--usr.bin/aucat/pipe.c10
-rw-r--r--usr.bin/aucat/safile.c14
-rw-r--r--usr.bin/aucat/sock.c22
-rw-r--r--usr.bin/aucat/wav.c6
16 files changed, 86 insertions, 86 deletions
diff --git a/usr.bin/aucat/abuf.c b/usr.bin/aucat/abuf.c
index d8a92a1f38a..47ff12add88 100644
--- a/usr.bin/aucat/abuf.c
+++ b/usr.bin/aucat/abuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: abuf.c,v 1.9 2008/11/09 16:26:07 ratchov Exp $ */
+/* $OpenBSD: abuf.c,v 1.10 2009/01/23 17:38:15 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -50,7 +50,7 @@ abuf_dprn(int n, struct abuf *buf, char *fmt, ...)
if (debug_level < n)
return;
- fprintf(stderr, "%s->%s: ",
+ fprintf(stderr, "%s->%s: ",
buf->wproc ? buf->wproc->name : "none",
buf->rproc ? buf->rproc->name : "none");
va_start(ap, fmt);
@@ -334,7 +334,7 @@ abuf_hup_do(struct abuf *buf)
*/
int
abuf_flush(struct abuf *buf)
-{
+{
if (buf->inuse) {
ABUF_DPRN(4, buf, "abuf_flush: blocked\n");
} else {
@@ -443,7 +443,7 @@ abuf_eof(struct abuf *buf)
buf->wproc = NULL;
if (buf->rproc != NULL) {
if (!abuf_flush(buf))
- return;
+ return;
if (ABUF_ROK(buf)) {
/*
* Could not flush everything, the reader will
@@ -496,7 +496,7 @@ abuf_ipos(struct abuf *buf, int delta)
if (p && p->ops->ipos) {
buf->inuse++;
- p->ops->ipos(p, buf, delta);
+ p->ops->ipos(p, buf, delta);
buf->inuse--;
}
if (ABUF_HUP(buf))
@@ -511,7 +511,7 @@ abuf_opos(struct abuf *buf, int delta)
{
struct aproc *p = buf->wproc;
-
+
if (p && p->ops->opos) {
buf->inuse++;
p->ops->opos(p, buf, delta);
diff --git a/usr.bin/aucat/abuf.h b/usr.bin/aucat/abuf.h
index 933be36a8ae..b4e0359b07d 100644
--- a/usr.bin/aucat/abuf.h
+++ b/usr.bin/aucat/abuf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: abuf.h,v 1.14 2008/11/16 16:30:22 ratchov Exp $ */
+/* $OpenBSD: abuf.h,v 1.15 2009/01/23 17:38:15 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -27,9 +27,9 @@ struct abuf {
/*
* Misc aproc-specific per-buffer parameters.
* since the buffer can connect any pair of aproc structure,
- * each aproc must have it's own specific data. Thus we cannot
+ * each aproc must have it's own specific data. Thus we cannot
* use an union. The only exception is the xrun field, because
- * there can be only one aproc that absorbs xruns in any
+ * there can be only one aproc that absorbs xruns in any
* intput->output path.
*/
int mixweight; /* dynamic range for the source stream */
@@ -44,7 +44,7 @@ struct abuf {
unsigned xrun; /* common to mix and sub */
LIST_ENTRY(abuf) ient; /* for mix inputs list */
LIST_ENTRY(abuf) oent; /* for sub outputs list */
-
+
/*
* fifo parameters
*/
diff --git a/usr.bin/aucat/amsg.h b/usr.bin/aucat/amsg.h
index ee8da901165..849ebc7b184 100644
--- a/usr.bin/aucat/amsg.h
+++ b/usr.bin/aucat/amsg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: amsg.h,v 1.3 2008/12/17 07:19:27 ratchov Exp $ */
+/* $OpenBSD: amsg.h,v 1.4 2009/01/23 17:38:15 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -30,7 +30,7 @@ struct amsg {
#define AMSG_GETPAR 1 /* get the current parameters */
#define AMSG_SETPAR 2 /* set the current parameters */
#define AMSG_START 3 /* request the server to start the stream */
-#define AMSG_STOP 4 /* request the server to stop the stream */
+#define AMSG_STOP 4 /* request the server to stop the stream */
#define AMSG_DATA 5 /* data block */
#define AMSG_MOVE 6 /* position changed */
#define AMSG_GETCAP 7 /* get capabilities */
diff --git a/usr.bin/aucat/aparams.c b/usr.bin/aucat/aparams.c
index c0fc85ae308..2e03c461d4e 100644
--- a/usr.bin/aucat/aparams.c
+++ b/usr.bin/aucat/aparams.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aparams.c,v 1.5 2008/11/20 10:10:01 ratchov Exp $ */
+/* $OpenBSD: aparams.c,v 1.6 2009/01/23 17:38:15 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -81,7 +81,7 @@ aparams_strtoenc(struct aparams *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') && \
@@ -97,7 +97,7 @@ aparams_strtoenc(struct aparams *par, char *istr)
} else
return 0;
p++;
-
+
/*
* get number of bits per sample
*/
@@ -185,7 +185,7 @@ aparams_init(struct aparams *par, unsigned cmin, unsigned cmax, unsigned rate)
*/
void
aparams_print(struct aparams *par)
-{
+{
char enc[ENCMAX];
aparams_enctostr(par, enc);
diff --git a/usr.bin/aucat/aproc.c b/usr.bin/aucat/aproc.c
index f7f417b8c19..e1abde18293 100644
--- a/usr.bin/aucat/aproc.c
+++ b/usr.bin/aucat/aproc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aproc.c,v 1.30 2008/12/29 17:59:08 ratchov Exp $ */
+/* $OpenBSD: aproc.c,v 1.31 2009/01/23 17:38:15 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -188,7 +188,7 @@ rpipe_out(struct aproc *p, struct abuf *obuf)
if (f->refs > 0)
return 0;
DPRINTFN(3, "rpipe_out: %s\n", p->name);
-
+
if (ABUF_FULL(obuf) || !(f->state & FILE_ROK))
return 0;
data = abuf_wgetblk(obuf, &count, 0);
@@ -246,7 +246,7 @@ rpipe_new(struct file *f)
p = aproc_new(&rpipe_ops, f->name);
p->u.io.file = f;
- f->rproc = p;
+ f->rproc = p;
return p;
}
@@ -295,7 +295,7 @@ wpipe_out(struct aproc *p, struct abuf *obuf_dummy)
DPRINTFN(3, "wpipe_out: %s\n", p->name);
if (!abuf_fill(ibuf)) {
- DPRINTFN(3, "wpipe_out: fill failed\n");
+ DPRINTFN(3, "wpipe_out: fill failed\n");
return 0;
}
if (ABUF_EMPTY(ibuf) || !(f->state & FILE_WOK))
@@ -407,7 +407,7 @@ mix_badd(struct abuf *ibuf, struct abuf *obuf)
return;
vol = (ibuf->mixweight * ibuf->mixvol) >> ADATA_SHIFT;
- ostart = ibuf->cmin - obuf->cmin;
+ ostart = ibuf->cmin - obuf->cmin;
onext = obuf->cmax - ibuf->cmax + ostart;
icnt = ibuf->cmax - ibuf->cmin + 1;
odata += ostart;
@@ -434,7 +434,7 @@ int
mix_xrun(struct abuf *i, struct abuf *obuf)
{
unsigned fdrop;
-
+
if (i->mixodone > 0)
return 1;
if (i->xrun == XRUN_ERROR) {
@@ -466,7 +466,7 @@ mix_in(struct aproc *p, struct abuf *ibuf)
DPRINTFN(4, "mix_in: used/len = %u/%u, done/todo = %u/%u\n",
ibuf->used, ibuf->len, ibuf->mixodone, obuf->mixitodo);
-
+
if (!ABUF_ROK(ibuf))
return 0;
odone = obuf->len;
@@ -501,7 +501,7 @@ mix_out(struct aproc *p, struct abuf *obuf)
obuf->used, obuf->len, obuf->mixitodo, obuf->len);
if (!ABUF_WOK(obuf))
- return 0;
+ return 0;
odone = obuf->len;
for (i = LIST_FIRST(&p->ibuflist); i != NULL; i = inext) {
inext = LIST_NEXT(i, ient);
@@ -700,7 +700,7 @@ sub_bcopy(struct abuf *ibuf, struct abuf *obuf)
}
idata += inext;
}
- abuf_wcommit(obuf, scount * obuf->bpf);
+ abuf_wcommit(obuf, scount * obuf->bpf);
obuf->subidone += scount * ibuf->bpf;
DPRINTFN(4, "sub_bcopy: %u frames\n", scount);
}
@@ -740,7 +740,7 @@ sub_in(struct aproc *p, struct abuf *ibuf)
{
struct abuf *i, *inext;
unsigned idone;
-
+
if (!ABUF_ROK(ibuf))
return 0;
idone = ibuf->len;
@@ -916,7 +916,7 @@ resamp_bcopy(struct aproc *p, struct abuf *ibuf, struct abuf *obuf)
unsigned iblksz;
unsigned ofr;
unsigned c;
- short *ctxbuf, *ctx;
+ short *ctxbuf, *ctx;
unsigned ctx_start;
unsigned icount, ocount;
@@ -1036,7 +1036,7 @@ resamp_hup(struct aproc *p, struct abuf *obuf)
void
resamp_ipos(struct aproc *p, struct abuf *ibuf, int delta)
{
- struct abuf *obuf = LIST_FIRST(&p->obuflist);
+ struct abuf *obuf = LIST_FIRST(&p->obuflist);
long long ipos;
int ifac, ofac;
@@ -1539,7 +1539,7 @@ dec_new(char *name, struct aparams *par)
}
#ifdef DEBUG
if (debug_level > 0) {
- fprintf(stderr, "dec_new: %s: ", p->name);
+ fprintf(stderr, "dec_new: %s: ", p->name);
aparams_print(par);
fprintf(stderr, "\n");
}
diff --git a/usr.bin/aucat/aproc.h b/usr.bin/aucat/aproc.h
index e07afed72fc..6ade66dcb6c 100644
--- a/usr.bin/aucat/aproc.h
+++ b/usr.bin/aucat/aproc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: aproc.h,v 1.15 2008/12/29 17:59:08 ratchov Exp $ */
+/* $OpenBSD: aproc.h,v 1.16 2009/01/23 17:38:15 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -148,7 +148,7 @@ struct aproc {
short ctx[NCHAN_MAX * RESAMP_NCTX];
unsigned iblksz, oblksz;
int diff;
- int idelta, odelta; /* reminder of conv_[io]pos */
+ int idelta, odelta; /* remainder of resamp_[io]pos */
} resamp;
struct {
short ctx[NCHAN_MAX];
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c
index 298c63ccaa7..7354603ea72 100644
--- a/usr.bin/aucat/aucat.c
+++ b/usr.bin/aucat/aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aucat.c,v 1.51 2009/01/10 20:02:28 ratchov Exp $ */
+/* $OpenBSD: aucat.c,v 1.52 2009/01/23 17:38:15 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -208,20 +208,20 @@ SLIST_HEAD(farglist, farg);
* to the given file name.
*/
void
-farg_add(struct farglist *list,
+farg_add(struct farglist *list,
struct aparams *ipar, struct aparams *opar, unsigned vol,
int hdr, int xrun, char *optarg)
{
struct farg *fa;
size_t namelen;
-
+
fa = malloc(sizeof(struct farg));
if (fa == NULL)
err(1, "%s", optarg);
if (hdr == HDR_AUTO) {
namelen = strlen(optarg);
- if (namelen >= 4 &&
+ if (namelen >= 4 &&
strcasecmp(optarg + namelen - 4, ".wav") == 0) {
fa->hdr = HDR_WAV;
DPRINTF("%s: assuming wav file format\n", optarg);
@@ -229,7 +229,7 @@ farg_add(struct farglist *list,
fa->hdr = HDR_RAW;
DPRINTF("%s: assuming headerless file\n", optarg);
}
- } else
+ } else
fa->hdr = hdr;
fa->xrun = xrun;
fa->ipar = *ipar;
@@ -508,12 +508,12 @@ main(int argc, char **argv)
if (n_flag) {
dev_loopinit(&dipar, &dopar, bufsz);
} else {
- dev_init(devpath,
+ dev_init(devpath,
(mode & MODE_REC) ? &dipar : NULL,
(mode & MODE_PLAY) ? &dopar : NULL,
bufsz);
}
-
+
/*
* Create buffers for all input and output pipes.
*/
diff --git a/usr.bin/aucat/dev.c b/usr.bin/aucat/dev.c
index a72513abe57..59893622a73 100644
--- a/usr.bin/aucat/dev.c
+++ b/usr.bin/aucat/dev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev.c,v 1.24 2009/01/10 20:02:28 ratchov Exp $ */
+/* $OpenBSD: dev.c,v 1.25 2009/01/23 17:38:15 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -48,10 +48,10 @@ dev_loopinit(struct aparams *dipar, struct aparams *dopar, unsigned bufsz)
dev_opar = par;
dev_round = (bufsz + 1) / 2;
dev_bufsz = dev_round * 2;
- dev_rate = rate;
+ dev_rate = rate;
dev_rec = NULL;
dev_play = NULL;
-
+
buf = abuf_new(dev_bufsz, &par);
dev_mix = mix_new("mix", dev_bufsz);
dev_mix->refs++;
@@ -115,7 +115,7 @@ dev_init(char *devpath,
struct aproc *conv;
struct abuf *buf;
unsigned nfr, ibufsz, obufsz;
-
+
/*
* ask for 1/4 of the buffer for the kernel ring and
* limit the block size to 1/4 of the requested buffer
@@ -210,7 +210,7 @@ dev_init(char *devpath,
buf = abuf_new(nfr, dopar);
aproc_setin(dev_play, buf);
obufsz += nfr;
-
+
/*
* append a converter, if needed
*/
@@ -414,8 +414,8 @@ dev_sync(struct abuf *ibuf, struct abuf *obuf)
* of the record chain. It's necessary to schedule silences (or
* drops) in order to start playback and record in sync.
*/
- delta =
- rbuf->bpf * (pbuf->abspos + pbuf->used) -
+ delta =
+ rbuf->bpf * (pbuf->abspos + pbuf->used) -
pbuf->bpf * rbuf->abspos;
delta /= pbuf->bpf * rbuf->bpf;
DPRINTF("dev_sync: delta = %d, ppos = %u, pused = %u, rpos = %u\n",
@@ -446,8 +446,8 @@ dev_sync(struct abuf *ibuf, struct abuf *obuf)
* and rec
*/
void
-dev_attach(char *name,
- struct abuf *ibuf, struct aparams *sipar, unsigned underrun,
+dev_attach(char *name,
+ struct abuf *ibuf, struct aparams *sipar, unsigned underrun,
struct abuf *obuf, struct aparams *sopar, unsigned overrun, int vol)
{
struct abuf *pbuf = NULL, *rbuf = NULL;
@@ -467,7 +467,7 @@ dev_attach(char *name,
ipar.sig = dev_opar.sig;
ipar.le = dev_opar.le;
ipar.msb = dev_opar.msb;
- aproc_setin(conv, ibuf);
+ aproc_setin(conv, ibuf);
ibuf = abuf_new(nblk * round, &ipar);
aproc_setout(conv, ibuf);
}
@@ -565,7 +565,7 @@ dev_clear(void)
struct abuf *buf;
if (dev_mix) {
- if (!LIST_EMPTY(&dev_mix->ibuflist)) {
+ if (!LIST_EMPTY(&dev_mix->ibuflist)) {
fprintf(stderr, "dev_clear: mixer not idle\n");
abort();
}
@@ -577,7 +577,7 @@ dev_clear(void)
mix_clear(dev_mix);
}
if (dev_sub) {
- if (!LIST_EMPTY(&dev_sub->obuflist)) {
+ if (!LIST_EMPTY(&dev_sub->obuflist)) {
fprintf(stderr, "dev_suspend: demux not idle\n");
abort();
}
diff --git a/usr.bin/aucat/file.c b/usr.bin/aucat/file.c
index 545d22d51e8..3a4e1beb938 100644
--- a/usr.bin/aucat/file.c
+++ b/usr.bin/aucat/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.9 2008/12/29 17:59:08 ratchov Exp $ */
+/* $OpenBSD: file.c,v 1.10 2009/01/23 17:38:15 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -261,7 +261,7 @@ void
filelist_unlisten(void)
{
struct file *f, *fnext;
-
+
for (f = LIST_FIRST(&file_list); f != NULL; f = fnext) {
fnext = LIST_NEXT(f, entry);
if (f->ops == &listen_ops)
diff --git a/usr.bin/aucat/file.h b/usr.bin/aucat/file.h
index 7fd9bad184e..3a341ebba28 100644
--- a/usr.bin/aucat/file.h
+++ b/usr.bin/aucat/file.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.h,v 1.5 2008/12/29 17:59:08 ratchov Exp $ */
+/* $OpenBSD: file.h,v 1.6 2009/01/23 17:38:15 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -31,7 +31,7 @@ struct fileops {
size_t size;
void (*close)(struct file *);
unsigned (*read)(struct file *, unsigned char *, unsigned);
- unsigned (*write)(struct file *, unsigned char *, unsigned);
+ unsigned (*write)(struct file *, unsigned char *, unsigned);
void (*start)(struct file *);
void (*stop)(struct file *);
int (*nfds)(struct file *);
diff --git a/usr.bin/aucat/headers.c b/usr.bin/aucat/headers.c
index 25bb23e9477..4dfe12c28f8 100644
--- a/usr.bin/aucat/headers.c
+++ b/usr.bin/aucat/headers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: headers.c,v 1.3 2008/11/16 17:08:32 ratchov Exp $ */
+/* $OpenBSD: headers.c,v 1.4 2009/01/23 17:38:15 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -43,7 +43,7 @@ struct wavfmt {
uint32_t rate;
uint32_t byterate;
uint16_t blkalign;
- uint16_t bits;
+ uint16_t bits;
} __packed;
char wav_id_riff[4] = { 'R', 'I', 'F', 'F' };
@@ -219,7 +219,7 @@ wav_writehdr(int fd, struct aparams *par)
memcpy(hdr.data_hdr.id, wav_id_data, 4);
hdr.data_hdr.size = htole32(datasz);
-
+
if (lseek(fd, 0, SEEK_SET) < 0) {
warn("wav_writehdr: lseek");
return 0;
diff --git a/usr.bin/aucat/listen.c b/usr.bin/aucat/listen.c
index 6676a26ee78..da17643451a 100644
--- a/usr.bin/aucat/listen.c
+++ b/usr.bin/aucat/listen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: listen.c,v 1.5 2008/11/16 20:44:03 ratchov Exp $ */
+/* $OpenBSD: listen.c,v 1.6 2009/01/23 17:38:15 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -64,8 +64,8 @@ listen_new(struct fileops *ops, char *path,
}
sockname.sun_family = AF_UNIX;
strlcpy(sockname.sun_path, path, sizeof(sockname.sun_path));
- if (bind(sock, (struct sockaddr *)&sockname,
- sizeof(struct sockaddr_un)) < 0) {
+ if (bind(sock, (struct sockaddr *)&sockname,
+ sizeof(struct sockaddr_un)) < 0) {
perror("bind");
exit(1);
}
diff --git a/usr.bin/aucat/pipe.c b/usr.bin/aucat/pipe.c
index f8679931f3a..ccee2e5a8d7 100644
--- a/usr.bin/aucat/pipe.c
+++ b/usr.bin/aucat/pipe.c
@@ -69,9 +69,9 @@ pipe_read(struct file *file, unsigned char *data, unsigned count)
#ifdef DEBUG
gettimeofday(&tv1, NULL);
timersub(&tv1, &tv0, &dtv);
- us = dtv.tv_sec * 1000000 + dtv.tv_usec;
- DPRINTFN(us < 5000 ? 4 : 1,
- "pipe_read: %s: got %d bytes in %uus\n",
+ us = dtv.tv_sec * 1000000 + dtv.tv_usec;
+ DPRINTFN(us < 5000 ? 4 : 1,
+ "pipe_read: %s: got %d bytes in %uus\n",
f->file.name, n, us);
#endif
return n;
@@ -86,7 +86,7 @@ pipe_write(struct file *file, unsigned char *data, unsigned count)
#ifdef DEBUG
struct timeval tv0, tv1, dtv;
unsigned us;
-
+
if (!(f->file.state & FILE_WOK)) {
DPRINTF("pipe_write: %s: bad state\n", f->file.name);
abort();
@@ -108,7 +108,7 @@ pipe_write(struct file *file, unsigned char *data, unsigned count)
#ifdef DEBUG
gettimeofday(&tv1, NULL);
timersub(&tv1, &tv0, &dtv);
- us = dtv.tv_sec * 1000000 + dtv.tv_usec;
+ us = dtv.tv_sec * 1000000 + dtv.tv_usec;
DPRINTFN(us < 5000 ? 4 : 1,
"pipe_write: %s: wrote %d bytes in %uus\n",
f->file.name, n, us);
diff --git a/usr.bin/aucat/safile.c b/usr.bin/aucat/safile.c
index 280edc936d5..2552de2337e 100644
--- a/usr.bin/aucat/safile.c
+++ b/usr.bin/aucat/safile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: safile.c,v 1.9 2008/12/29 17:59:08 ratchov Exp $ */
+/* $OpenBSD: safile.c,v 1.10 2009/01/23 17:38:15 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -34,7 +34,7 @@
struct safile {
struct file file;
struct sio_hdl *hdl;
-#ifdef DEBUG
+#ifdef DEBUG
struct timeval itv, otv;
#endif
};
@@ -160,7 +160,7 @@ safile_new(struct fileops *ops, char *path,
void
safile_start(struct file *file)
-{
+{
struct safile *f = (struct safile *)file;
if (!sio_start(f->hdl)) {
@@ -214,9 +214,9 @@ safile_read(struct file *file, unsigned char *data, unsigned count)
#ifdef DEBUG
gettimeofday(&tv1, NULL);
timersub(&tv1, &tv0, &dtv);
- us = dtv.tv_sec * 1000000 + dtv.tv_usec;
+ us = dtv.tv_sec * 1000000 + dtv.tv_usec;
DPRINTFN(us < 5000 ? 4 : 1,
- "safile_read: %s: got %d bytes in %uus\n",
+ "safile_read: %s: got %d bytes in %uus\n",
f->file.name, n, us);
#endif
return n;
@@ -231,7 +231,7 @@ safile_write(struct file *file, unsigned char *data, unsigned count)
#ifdef DEBUG
struct timeval tv0, tv1, dtv;
unsigned us;
-
+
if (!(f->file.state & FILE_WOK)) {
DPRINTF("safile_write: %s: bad state\n", f->file.name);
abort();
@@ -253,7 +253,7 @@ safile_write(struct file *file, unsigned char *data, unsigned count)
#ifdef DEBUG
gettimeofday(&tv1, NULL);
timersub(&tv1, &tv0, &dtv);
- us = dtv.tv_sec * 1000000 + dtv.tv_usec;
+ us = dtv.tv_sec * 1000000 + dtv.tv_usec;
DPRINTFN(us < 5000 ? 4 : 1,
"safile_write: %s: wrote %d bytes in %uus\n",
f->file.name, n, us);
diff --git a/usr.bin/aucat/sock.c b/usr.bin/aucat/sock.c
index 8a94eb71e07..85b9ba02e98 100644
--- a/usr.bin/aucat/sock.c
+++ b/usr.bin/aucat/sock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sock.c,v 1.11 2008/12/29 17:59:08 ratchov Exp $ */
+/* $OpenBSD: sock.c,v 1.12 2009/01/23 17:38:15 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -94,7 +94,7 @@ rsock_out(struct aproc *p, struct abuf *obuf)
DPRINTFN(4, "rsock_out: %p\n", f);
- /*
+ /*
* when calling sock_read(), we may receive a ``STOP'' command,
* and detach ``obuf''. In this case, there's no more caller and
* we'll stop processing further messages, resulting in a dead lock.
@@ -103,7 +103,7 @@ rsock_out(struct aproc *p, struct abuf *obuf)
*/
for (;;) {
if (!sock_read(f))
- return 0;
+ return 0;
}
return 1;
}
@@ -313,7 +313,7 @@ void
sock_freebuf(struct sock *f)
{
struct abuf *rbuf, *wbuf;
-
+
f->pstate = SOCK_INIT;
DPRINTF("sock_freebuf:\n");
rbuf = LIST_FIRST(&f->pipe.file.rproc->obuflist);
@@ -357,9 +357,9 @@ void
sock_setvol(struct sock *f, int vol)
{
struct abuf *rbuf;
-
+
f->vol = vol;
- rbuf = LIST_FIRST(&f->pipe.file.rproc->obuflist);
+ rbuf = LIST_FIRST(&f->pipe.file.rproc->obuflist);
if (!rbuf) {
DPRINTF("sock_setvol: no read buffer yet\n");
return;
@@ -384,7 +384,7 @@ sock_attach(struct sock *f, int force)
*/
if (!force && rbuf && ABUF_WOK(rbuf))
return 0;
-
+
DPRINTF("sock_attach: %p\n", f);
f->pstate = SOCK_RUN;
@@ -561,7 +561,7 @@ sock_wdata(struct sock *f)
if (n == 0)
return 0;
f->wtodo -= n;
- }
+ }
return 1;
}
@@ -570,7 +570,7 @@ sock_setpar(struct sock *f)
{
struct amsg_par *p = &f->rmsg.u.par;
unsigned min, max, rate;
-
+
if (AMSG_ISSET(p->mode)) {
if ((p->mode & ~(AMSG_PLAY | AMSG_REC)) || p->mode == 0) {
DPRINTF("sock_setpar: bad mode %x\n", p->mode);
@@ -780,7 +780,7 @@ sock_execmsg(struct sock *f)
m->u.par.rchan = f->wpar.cmax - f->wpar.cmin + 1;
m->u.par.pchan = f->rpar.cmax - f->rpar.cmin + 1;
m->u.par.appbufsz = f->bufsz;
- m->u.par.bufsz =
+ m->u.par.bufsz =
f->bufsz + (dev_bufsz / dev_round) * f->round;
m->u.par.round = f->round;
f->rstate = SOCK_RRET;
@@ -848,7 +848,7 @@ sock_buildmsg(struct sock *f)
struct aproc *p;
struct abuf *ibuf;
int *pdelta;
-
+
/*
* if pos changed, build a MOVE message
*/
diff --git a/usr.bin/aucat/wav.c b/usr.bin/aucat/wav.c
index 042f714f34d..212fd2d7fff 100644
--- a/usr.bin/aucat/wav.c
+++ b/usr.bin/aucat/wav.c
@@ -12,7 +12,7 @@
* max data of a .wav file. The total file size must be smaller than
* 2^31, and we also have to leave some space for the headers (around 40
* bytes)
- */
+ */
#define WAV_DATAMAX (0x7fff0000)
struct fileops wav_ops = {
@@ -54,7 +54,7 @@ wav_new_out(struct fileops *ops, int fd, char *name,
f = (struct wav *)pipe_new(ops, fd, name);
if (hdr == HDR_WAV) {
par->le = 1;
- par->sig = (par->bits <= 8) ? 0 : 1;
+ par->sig = (par->bits <= 8) ? 0 : 1;
par->bps = (par->bits + 7) / 8;
if (!wav_writehdr(f->pipe.fd, par))
exit(1);
@@ -92,7 +92,7 @@ wav_write(struct file *file, unsigned char *data, unsigned count)
{
struct wav *f = (struct wav *)file;
unsigned n;
-
+
if (f->wbytes >= 0 && count > f->wbytes) {
count = f->wbytes; /* wbytes fits in count */
if (count == 0) {