Fix white space and formatting nits.

This commit is contained in:
simonb 2001-03-28 03:18:39 +00:00
parent a378517ea4
commit 3fa9ceaa88
2 changed files with 13 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ctl.c,v 1.26 2001/02/19 23:03:43 cgd Exp $ */ /* $NetBSD: ctl.c,v 1.27 2001/03/28 03:18:39 simonb Exp $ */
/* /*
* Copyright (c) 1997 The NetBSD Foundation, Inc. * Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -312,7 +312,7 @@ getinfo(fd)
if (pos >= sizeof(encbuf)-1) if (pos >= sizeof(encbuf)-1)
break; break;
pos += snprintf(encbuf+pos, sizeof(encbuf)-pos, "%s:%d%s", pos += snprintf(encbuf+pos, sizeof(encbuf)-pos, "%s:%d%s",
enc.name, enc.precision, enc.name, enc.precision,
enc.flags & AUDIO_ENCODINGFLAG_EMULATED ? "*" : ""); enc.flags & AUDIO_ENCODINGFLAG_EMULATED ? "*" : "");
} }
if (ioctl(fd, AUDIO_GETFD, &fullduplex) < 0) if (ioctl(fd, AUDIO_GETFD, &fullduplex) < 0)
@ -346,11 +346,11 @@ main(argc, argv)
struct stat dstat, ostat; struct stat dstat, ostat;
const char *file; const char *file;
char *sep = "="; char *sep = "=";
file = getenv("AUDIOCTLDEVICE"); file = getenv("AUDIOCTLDEVICE");
if (file == 0) if (file == 0)
file = _PATH_AUDIOCTL; file = _PATH_AUDIOCTL;
while ((ch = getopt(argc, argv, "af:nw")) != -1) { while ((ch = getopt(argc, argv, "af:nw")) != -1) {
switch(ch) { switch(ch) {
case 'a': case 'a':
@ -372,7 +372,7 @@ main(argc, argv)
} }
argc -= optind; argc -= optind;
argv += optind; argv += optind;
fd = open(file, O_WRONLY); fd = open(file, O_WRONLY);
if (fd < 0) if (fd < 0)
fd = open(file, O_RDONLY); fd = open(file, O_RDONLY);
@ -387,7 +387,7 @@ main(argc, argv)
#endif #endif
if (fd < 0) if (fd < 0)
err(1, "%s", file); err(1, "%s", file);
/* Check if stdout is the same device as the audio device. */ /* Check if stdout is the same device as the audio device. */
if (fstat(fd, &dstat) < 0) if (fstat(fd, &dstat) < 0)
err(1, "fstat audioctl"); err(1, "fstat audioctl");

View File

@ -1,4 +1,4 @@
/* $NetBSD: play.c,v 1.24 2001/03/08 06:28:14 ross Exp $ */ /* $NetBSD: play.c,v 1.25 2001/03/28 03:18:39 simonb Exp $ */
/* /*
* Copyright (c) 1999 Matthew R. Green * Copyright (c) 1999 Matthew R. Green
@ -272,8 +272,8 @@ play(file)
err(1, "munmap failed"); err(1, "munmap failed");
close(fd); close(fd);
} }
/* /*
* play the file on on the file descriptor fd * play the file on on the file descriptor fd
*/ */
@ -328,7 +328,7 @@ play_fd(file, fd)
} }
if (write(audiofd, buffer, datainbuf) != datainbuf) if (write(audiofd, buffer, datainbuf) != datainbuf)
err(1, "write failed"); err(1, "write failed");
datasize -= datainbuf; datasize -= datainbuf;
datainbuf = 0; datainbuf = 0;
} }
@ -357,7 +357,7 @@ audioctl_write_fromhdr(hdr, fsz, fd, datasize)
AUDIO_INITINFO(&info); AUDIO_INITINFO(&info);
sunhdr = hdr; sunhdr = hdr;
if (ntohl(sunhdr->magic) == AUDIO_FILE_MAGIC) { if (ntohl(sunhdr->magic) == AUDIO_FILE_MAGIC) {
if (audio_sun_to_encoding(ntohl(sunhdr->encoding), if (audio_sun_to_encoding(ntohl(sunhdr->encoding),
&info.play.encoding, &info.play.precision)) { &info.play.encoding, &info.play.precision)) {
if (!qflag) if (!qflag)
warnx("unknown unsupported Sun audio encoding" warnx("unknown unsupported Sun audio encoding"
@ -369,9 +369,9 @@ audioctl_write_fromhdr(hdr, fsz, fd, datasize)
info.play.sample_rate = ntohl(sunhdr->sample_rate); info.play.sample_rate = ntohl(sunhdr->sample_rate);
info.play.channels = ntohl(sunhdr->channels); info.play.channels = ntohl(sunhdr->channels);
hdr_len = ntohl(sunhdr->hdr_size); hdr_len = ntohl(sunhdr->hdr_size);
*datasize = ntohl(sunhdr->data_size); *datasize = ntohl(sunhdr->data_size);
goto set_audio_mode; goto set_audio_mode;
} }
@ -419,7 +419,7 @@ set_audio_mode:
if (ioctl(fd, AUDIO_SETINFO, &info) < 0) if (ioctl(fd, AUDIO_SETINFO, &info) < 0)
err(1, "failed to set audio info"); err(1, "failed to set audio info");
return (hdr_len); return (hdr_len);
} }