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.
|
* Copyright (c) 1999, 2000, 2001 Andrew Doran.
|
||||||
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#ifndef lint
|
#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 */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -603,8 +603,8 @@ run(int cmd, const char *arg)
|
|||||||
int
|
int
|
||||||
play(const char *arg, int fromuser)
|
play(const char *arg, int fromuser)
|
||||||
{
|
{
|
||||||
int rv, n, start, end, istart, iend, blk, len, relend;
|
int rv, start, end, istart, iend, blk, len, relend;
|
||||||
u_int tr1, tr2, m1, m2, s1, s2, f1, f2, tm, ts, tf;
|
u_int n, tr1, tr2, m1, m2, s1, s2, f1, f2, tm, ts, tf;
|
||||||
struct ioc_toc_header h;
|
struct ioc_toc_header h;
|
||||||
|
|
||||||
if (shuffle && fromuser) {
|
if (shuffle && fromuser) {
|
||||||
@ -878,8 +878,9 @@ skip(int dir, int fromuser)
|
|||||||
if (dir == 0 || shuffle != 0) {
|
if (dir == 0 || shuffle != 0) {
|
||||||
if (fromuser || (rv != CD_AS_PLAY_IN_PROGRESS &&
|
if (fromuser || (rv != CD_AS_PLAY_IN_PROGRESS &&
|
||||||
rv != CD_AS_PLAY_PAUSED))
|
rv != CD_AS_PLAY_PAUSED))
|
||||||
trk = shuffle < 0 ? (-shuffle) : (h.starting_track +
|
trk = shuffle < 0 ? (-shuffle) :
|
||||||
arc4random() % (h.ending_track - h.starting_track + 1));
|
(int)((h.starting_track +
|
||||||
|
arc4random() % (h.ending_track - h.starting_track + 1)));
|
||||||
else
|
else
|
||||||
return (0);
|
return (0);
|
||||||
} else {
|
} else {
|
||||||
@ -1192,7 +1193,8 @@ get_status(int *trk, int *idx, int *min, int *sec, int *frame)
|
|||||||
struct ioc_toc_header h;
|
struct ioc_toc_header h;
|
||||||
u_int mm, ss, ff;
|
u_int mm, ss, ff;
|
||||||
int rv;
|
int rv;
|
||||||
int lba, i, n, rc;
|
int i, n, rc;
|
||||||
|
uint32_t lba;
|
||||||
|
|
||||||
if (!tbvalid) {
|
if (!tbvalid) {
|
||||||
if ((rc = ioctl(fd, CDIOREADTOCHEADER, &h)) < 0) {
|
if ((rc = ioctl(fd, CDIOREADTOCHEADER, &h)) < 0) {
|
||||||
@ -1263,7 +1265,7 @@ parse(char *buf, int *cmd)
|
|||||||
{
|
{
|
||||||
const struct cmdtab *c, *mc;
|
const struct cmdtab *c, *mc;
|
||||||
char *p, *q;
|
char *p, *q;
|
||||||
int len;
|
unsigned int len;
|
||||||
|
|
||||||
for (p = buf; isspace((unsigned char)*p); p++)
|
for (p = buf; isspace((unsigned char)*p); p++)
|
||||||
continue;
|
continue;
|
||||||
@ -1297,7 +1299,7 @@ parse(char *buf, int *cmd)
|
|||||||
}
|
}
|
||||||
/* Try short hand forms then... */
|
/* Try short hand forms then... */
|
||||||
if (len >= c->min && strncasecmp(buf, c->name, len) == 0) {
|
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");
|
warnx("ambiguous command");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user