fix -W sign-compare issues.
This commit is contained in:
parent
53d5aab9a2
commit
39a8950629
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cdplay.c,v 1.41 2009/02/22 08:32:25 dholland Exp $ */
|
||||
/* $NetBSD: cdplay.c,v 1.42 2009/04/11 11:52:35 lukem Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999, 2000, 2001 Andrew Doran.
|
||||
@ -40,7 +40,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: cdplay.c,v 1.41 2009/02/22 08:32:25 dholland Exp $");
|
||||
__RCSID("$NetBSD: cdplay.c,v 1.42 2009/04/11 11:52:35 lukem Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -603,8 +603,8 @@ run(int cmd, const char *arg)
|
||||
int
|
||||
play(const char *arg, int fromuser)
|
||||
{
|
||||
int rv, n, start, end, istart, iend, blk, len, relend;
|
||||
u_int tr1, tr2, m1, m2, s1, s2, f1, f2, tm, ts, tf;
|
||||
int rv, start, end, istart, iend, blk, len, relend;
|
||||
u_int n, tr1, tr2, m1, m2, s1, s2, f1, f2, tm, ts, tf;
|
||||
struct ioc_toc_header h;
|
||||
|
||||
if (shuffle && fromuser) {
|
||||
@ -878,8 +878,9 @@ skip(int dir, int fromuser)
|
||||
if (dir == 0 || shuffle != 0) {
|
||||
if (fromuser || (rv != CD_AS_PLAY_IN_PROGRESS &&
|
||||
rv != CD_AS_PLAY_PAUSED))
|
||||
trk = shuffle < 0 ? (-shuffle) : (h.starting_track +
|
||||
arc4random() % (h.ending_track - h.starting_track + 1));
|
||||
trk = shuffle < 0 ? (-shuffle) :
|
||||
(int)((h.starting_track +
|
||||
arc4random() % (h.ending_track - h.starting_track + 1)));
|
||||
else
|
||||
return (0);
|
||||
} else {
|
||||
@ -1192,7 +1193,8 @@ get_status(int *trk, int *idx, int *min, int *sec, int *frame)
|
||||
struct ioc_toc_header h;
|
||||
u_int mm, ss, ff;
|
||||
int rv;
|
||||
int lba, i, n, rc;
|
||||
int i, n, rc;
|
||||
uint32_t lba;
|
||||
|
||||
if (!tbvalid) {
|
||||
if ((rc = ioctl(fd, CDIOREADTOCHEADER, &h)) < 0) {
|
||||
@ -1263,7 +1265,7 @@ parse(char *buf, int *cmd)
|
||||
{
|
||||
const struct cmdtab *c, *mc;
|
||||
char *p, *q;
|
||||
int len;
|
||||
unsigned int len;
|
||||
|
||||
for (p = buf; isspace((unsigned char)*p); p++)
|
||||
continue;
|
||||
@ -1297,7 +1299,7 @@ parse(char *buf, int *cmd)
|
||||
}
|
||||
/* Try short hand forms then... */
|
||||
if (len >= c->min && strncasecmp(buf, c->name, len) == 0) {
|
||||
if (*cmd != -1 && *cmd != c->command) {
|
||||
if (*cmd != -1 && *cmd != (int)c->command) {
|
||||
warnx("ambiguous command");
|
||||
return (0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user