fix -Wsign-compare and other WARNS=4 issues

This commit is contained in:
lukem 2009-04-11 10:43:09 +00:00
parent 77dafb503d
commit 31582cc99b
3 changed files with 14 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ctl.c,v 1.37 2008/04/28 20:24:12 martin Exp $ */
/* $NetBSD: ctl.c,v 1.38 2009/04/11 10:43:09 lukem Exp $ */
/*
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: ctl.c,v 1.37 2008/04/28 20:24:12 martin Exp $");
__RCSID("$NetBSD: ctl.c,v 1.38 2009/04/11 10:43:09 lukem Exp $");
#endif
@ -302,11 +302,11 @@ getinfo(fd)
enc.index = i;
if (ioctl(fd, AUDIO_GETENC, &enc) < 0)
break;
if (pos >= sizeof(encbuf)-1)
if (pos >= (int)sizeof(encbuf)-1)
break;
if (pos)
encbuf[pos++] = ',';
if (pos >= sizeof(encbuf)-1)
if (pos >= (int)sizeof(encbuf)-1)
break;
pos += snprintf(encbuf+pos, sizeof(encbuf)-pos, "%s:%d%s",
enc.name, enc.precision,

View File

@ -1,4 +1,4 @@
/* $NetBSD: play.c,v 1.49 2008/05/29 14:51:27 mrg Exp $ */
/* $NetBSD: play.c,v 1.50 2009/04/11 10:43:09 lukem Exp $ */
/*
* Copyright (c) 1999 Matthew R. Green
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: play.c,v 1.49 2008/05/29 14:51:27 mrg Exp $");
__RCSID("$NetBSD: play.c,v 1.50 2009/04/11 10:43:09 lukem Exp $");
#endif
@ -277,19 +277,19 @@ play(file)
filesize -= hdrlen;
addr = (char *)addr + hdrlen;
if (filesize < datasize || datasize == 0) {
if (filesize < datasize)
if ((uint64_t)filesize < datasize || datasize == 0) {
if ((uint64_t)filesize < datasize)
warnx("bogus datasize: %ld", (u_long)datasize);
datasize = filesize;
}
while (datasize > bufsize) {
if (write(audiofd, addr, bufsize) != bufsize)
if ((size_t)write(audiofd, addr, bufsize) != bufsize)
err(1, "write failed");
addr = (char *)addr + bufsize;
datasize -= bufsize;
}
if (write(audiofd, addr, (size_t)datasize) != (ssize_t)datasize)
if ((size_t)write(audiofd, addr, datasize) != datasize)
err(1, "final write failed");
if (ioctl(audiofd, AUDIO_DRAIN) < 0 && !qflag)

View File

@ -1,4 +1,4 @@
/* $NetBSD: record.c,v 1.46 2008/05/29 14:51:27 mrg Exp $ */
/* $NetBSD: record.c,v 1.47 2009/04/11 10:43:10 lukem Exp $ */
/*
* Copyright (c) 1999, 2002 Matthew R. Green
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: record.c,v 1.46 2008/05/29 14:51:27 mrg Exp $");
__RCSID("$NetBSD: record.c,v 1.47 2009/04/11 10:43:10 lukem Exp $");
#endif
@ -334,11 +334,11 @@ main(argc, argv)
(void)gettimeofday(&start_time, NULL);
while (no_time_limit || timeleft(&start_time, &record_time)) {
if (read(audiofd, buffer, bufsize) != bufsize)
if ((size_t)read(audiofd, buffer, bufsize) != bufsize)
err(1, "read failed");
if (conv_func)
(*conv_func)(buffer, bufsize);
if (write(outfd, buffer, bufsize) != bufsize)
if ((size_t)write(outfd, buffer, bufsize) != bufsize)
err(1, "write failed");
total_size += bufsize;
}