Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/cdplay cdplay: remove redundant parentheses around r...
details: https://anonhg.NetBSD.org/src/rev/0c70f9dd32a3
branches: trunk
changeset: 941114:0c70f9dd32a3
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Oct 18 21:58:32 2020 +0000
description:
cdplay: remove redundant parentheses around return value
Purely cosmetic change. The generated code stays exactly the same.
diffstat:
usr.bin/cdplay/cdplay.c | 128 ++++++++++++++++++++++++------------------------
1 files changed, 64 insertions(+), 64 deletions(-)
diffs (truncated from 513 to 300 lines):
diff -r f8ed92f3af58 -r 0c70f9dd32a3 usr.bin/cdplay/cdplay.c
--- a/usr.bin/cdplay/cdplay.c Sun Oct 18 21:37:24 2020 +0000
+++ b/usr.bin/cdplay/cdplay.c Sun Oct 18 21:58:32 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cdplay.c,v 1.49 2015/06/17 00:01:59 christos Exp $ */
+/* $NetBSD: cdplay.c,v 1.50 2020/10/18 21:58:32 rillig Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Andrew Doran.
@@ -40,7 +40,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: cdplay.c,v 1.49 2015/06/17 00:01:59 christos Exp $");
+__RCSID("$NetBSD: cdplay.c,v 1.50 2020/10/18 21:58:32 rillig Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -277,7 +277,7 @@
}
*p = '\0';
arg = parse(buf, &cmd);
- return (run(cmd, arg));
+ return run(cmd, arg);
}
setbuf(stdout, NULL);
@@ -372,7 +372,7 @@
intv_usecs = 13333 * da.fpw;
/*
* interrupt earlier for safety, by a value which
- * doesn't hurt interactice response if we block
+ * doesn't hurt interactive response if we block
* in the signal handler
*/
intv_usecs -= 50000;
@@ -387,20 +387,20 @@
da.aubuf = malloc(da.fpw * CDDA_SIZE);
if (da.aubuf == NULL) {
warn("Not enough memory for audio buffers");
- return (1);
+ return 1;
}
if (da.afd == -1 && !openaudio()) {
warn("Cannot open audio device");
- return (1);
+ return 1;
}
itv_timer.it_interval.tv_sec = itv_timer.it_value.tv_sec =
intv_usecs / 1000000;
itv_timer.it_interval.tv_usec = itv_timer.it_value.tv_usec =
intv_usecs % 1000000;
rv = setitimer(ITIMER_REAL, &itv_timer, NULL);
- if (rv == 0) {
+ if (rv == 0)
digital = 1;
- } else
+ else
warn("setitimer in CMD_DIGITAL");
msf = 0;
tbvalid = 0;
@@ -437,7 +437,7 @@
}
if (fd < 0 && !opencd())
- return (0);
+ return 0;
switch (cmd) {
case CMD_INFO:
@@ -451,7 +451,7 @@
case CMD_PAUSE:
if (digital) {
da.playing = 0;
- return (0);
+ return 0;
} else if ((rv = ioctl(fd, CDIOCPAUSE)) < 0)
warn("ioctl(CDIOCPAUSE)");
break;
@@ -459,7 +459,7 @@
case CMD_RESUME:
if (digital) {
da.playing = 1;
- return (0);
+ return 0;
} else if ((rv = ioctl(fd, CDIOCRESUME)) < 0)
warn("ioctl(CDIOCRESUME)");
break;
@@ -467,7 +467,7 @@
case CMD_STOP:
if (digital) {
da.playing = 0;
- return (0);
+ return 0;
} else {
if ((rv = ioctl(fd, CDIOCSTOP)) < 0)
warn("ioctl(CDIOCSTOP)");
@@ -479,7 +479,7 @@
case CMD_RESET:
tbvalid = 0;
IOCTL_SIMPLE(fd, CDIOCRESET);
- return (0);
+ return 0;
case CMD_EJECT:
tbvalid = 0;
@@ -634,7 +634,7 @@
break;
}
- return (rv);
+ return rv;
}
static int
@@ -647,12 +647,12 @@
if (shuffle && fromuser) {
warnx("`play' not valid in shuffle mode");
- return (0);
+ return 0;
}
if ((rv = ioctl(fd, CDIOREADTOCHEADER, &h)) < 0) {
warn("ioctl(CDIOREADTOCHEADER)");
- return (int)(rv);
+ return (int)rv;
}
end = 0;
@@ -660,11 +660,11 @@
n = h.ending_track - h.starting_track + 1;
rv = read_toc_entries((n + 1) * sizeof(struct cd_toc_entry));
if (rv < 0)
- return (int)(rv);
+ return (int)rv;
if (arg == NULL || *arg == '\0') {
/* Play the whole disc */
- return (play_track(h.starting_track, 1, h.ending_track, 99));
+ return play_track(h.starting_track, 1, h.ending_track, 99);
}
if (strchr(arg, '#') != NULL) {
@@ -678,14 +678,14 @@
if (len == 0) {
len = toc2lba(n);
}
- return (play_blocks(blk, len));
+ return play_blocks(blk, len);
}
if (strchr(arg, ':') != NULL) {
/*
* Play MSF m1:s1 [ .f1 ] [ m2:s2 [ .f2 ] ]
*
- * Will now also undestand timed addresses relative
+ * Will now also understand timed addresses relative
* to the beginning of a track in the form...
*
* tr1 m1:s1[.f1] [[tr2] [m2:s2[.f2]]]
@@ -776,7 +776,7 @@
if ((m1 > tm) || ((m1 == tm) && ((s1 > ts) || ((s1 == ts) &&
(f1 > tf))))) {
warnx("Track %d is not that long.", tr1);
- return (0);
+ return 0;
}
tr1--; /* XXXXX ???? */
@@ -809,10 +809,10 @@
if ((tr2 < n) && ((m2 > tm) || ((m2 == tm) && ((s2 > ts) ||
((s2 == ts) && (f2 > tf)))))) {
warnx("The playing time of the disc is not that long.");
- return (0);
+ return 0;
}
- return (play_msf(m1, s1, f1, m2, s2, f2));
+ return play_msf(m1, s1, f1, m2, s2, f2);
Try_Absolute_Timed_Addresses:
m2 = UINT_MAX;
@@ -838,7 +838,7 @@
f2 = tf;
}
}
- return (play_msf(m1, s1, f1, m2, s2, f2));
+ return play_msf(m1, s1, f1, m2, s2, f2);
}
/*
@@ -854,11 +854,11 @@
if (end == 0)
end = n;
- return (play_track(start, istart, end, iend));
+ return play_track(start, istart, end, iend);
Clean_up:
warnx("invalid command arguments");
- return (0);
+ return 0;
}
static void
@@ -909,10 +909,10 @@
if ((rv = ioctl(fd, CDIOREADTOCHEADER, &h)) < 0) {
warn("ioctl(CDIOREADTOCHEADER)");
- return (rv);
+ return rv;
}
if ((rv = get_status(&trk, &idx, &m, &s, &f)) < 0)
- return (rv);
+ return rv;
if (dir == 0 || shuffle != 0) {
if (fromuser || (rv != CD_AS_PLAY_IN_PROGRESS &&
@@ -921,7 +921,7 @@
(int)((h.starting_track +
arc4random() % (h.ending_track - h.starting_track + 1)));
else
- return (0);
+ return 0;
} else {
trk += dir;
if (trk > h.ending_track)
@@ -935,7 +935,7 @@
else
snprintf(str, sizeof(str), "%d", trk);
- return (play(str, 0));
+ return play(str, 0);
}
static const char *
@@ -967,7 +967,7 @@
break;
}
- return (str);
+ return str;
}
static int
@@ -996,7 +996,7 @@
"(%d frames per wakeup, %lld.%06lds period)\n",
da.auname, da.fpw,
(long long)itv_timer.it_interval.tv_sec,
-
+
(long)itv_timer.it_interval.tv_usec);
else
printf("digital xfer:\toff\n");
@@ -1019,7 +1019,7 @@
printf("media catalog:\tnone\n");
if (digital)
- return (0);
+ return 0;
if (ioctl(fd, CDIOCGETVOL, &v) >= 0) {
printf("left volume:\t%d\n", v.vol[0]);
printf("right volume:\t%d\n", v.vol[1]);
@@ -1028,7 +1028,7 @@
printf("right volume:\tnot available\n");
}
-; return (0);
+ return 0;
}
static int
@@ -1039,13 +1039,13 @@
if ((rc = ioctl(fd, CDIOREADTOCHEADER, &h)) < 0) {
warn("ioctl(CDIOREADTOCHEADER)");
- return (rc);
+ return rc;
}
n = h.ending_track - h.starting_track + 1;
rc = read_toc_entries((n + 1) * sizeof(struct cd_toc_entry));
if (rc < 0)
- return (rc);
+ return rc;
printf("track start duration block length type\n");
printf("--------------------------------------------------\n");
@@ -1056,7 +1056,7 @@
}
printf(" - "); /* Lead-out area */
print_track(toc_buffer + n);
- return (0);
+ return 0;
}
static void
@@ -1150,7 +1150,7 @@
errno = oerrno;
Home |
Main Index |
Thread Index |
Old Index