Date: Sun, 8 Jul 2001 15:12:42 -0400 (EDT) From: Mike Barcroft <mike@q9media.com> To: FreeBSD-gnats-submit@freebsd.org Cc: sos@freebsd.org Subject: bin/28824: [patch] src/usr.sbin/burncd warning clean up Message-ID: <200107081912.f68JCgP17359@coffee.q9media.com>
next in thread | raw e-mail | index | archive | help
>Number: 28824
>Category: bin
>Synopsis: [patch] src/usr.sbin/burncd warning clean up
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Jul 08 12:00:05 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Mike Barcroft
>Release: FreeBSD 5.0-CURRENT i386
>Organization:
Q9 Media
>Environment:
$FreeBSD: src/usr.sbin/burncd/Makefile,v 1.4 2001/03/26 14:39:38 ru Exp $
$FreeBSD: src/usr.sbin/burncd/burncd.c,v 1.13 2001/05/30 08:13:39 sos Exp $
>Description:
[An earlier version of this patch was sent directly to sos@FreeBSD.org,
but I received no reply.]
o Clean up compile-time warnings.
o Set WARNS?=2
o Tested on i386 and alpha.
>How-To-Repeat:
N/A
>Fix:
Index: burncd/Makefile
===================================================================
RCS file: /home/ncvs/src/usr.sbin/burncd/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- burncd/Makefile 2001/03/26 14:39:38 1.4
+++ burncd/Makefile 2001/07/08 18:25:49
@@ -1,6 +1,7 @@
# $FreeBSD: src/usr.sbin/burncd/Makefile,v 1.4 2001/03/26 14:39:38 ru Exp $
PROG= burncd
+WARNS?= 2
MAN= burncd.8
.include <bsd.prog.mk>
Index: burncd/burncd.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/burncd/burncd.c,v
retrieving revision 1.13
diff -u -r1.13 burncd.c
--- burncd/burncd.c 2001/05/30 08:13:39 1.13
+++ burncd/burncd.c 2001/07/08 18:25:50
@@ -56,7 +56,7 @@
{
int ch, arg, addr;
int eject=0, list=0, multi=0, preemp=0, speed=1, test_write=0;
- char *devname = "/dev/acd0c", *prog_name;
+ const char *dev_name = "/dev/acd0c", *prog_name;
int block_size = 0;
prog_name = argv[0];
@@ -67,7 +67,7 @@
break;
case 'f':
- devname = optarg;
+ dev_name = optarg;
break;
case 'l':
@@ -106,8 +106,8 @@
if (argc == 0)
usage(prog_name);
- if ((fd = open(devname, O_RDWR, 0)) < 0)
- err(EX_NOINPUT, "open(%s)", devname);
+ if ((fd = open(dev_name, O_RDWR, 0)) < 0)
+ err(EX_NOINPUT, "open(%s)", dev_name);
if (ioctl(fd, CDRIOCWRITESPEED, &speed) < 0)
err(EX_IOERR, "ioctl(CDRIOCWRITESPEED)");
@@ -134,7 +134,7 @@
err(EX_IOERR, "ioctl(CDIOREADTOCENTRY)");
if (ioctl(fd, CDRIOCNEXTWRITEABLEADDR, &addr) < 0)
err(EX_IOERR, "ioctl(CDRIOCNEXTWRITEABLEADDR)");
- fprintf(stderr, "%d, %d\n",
+ fprintf(stderr, "%ul, %d\n",
ntohl(entry.entry.addr.lba), addr);
break;
@@ -207,7 +207,7 @@
while (fgets(file_buf, sizeof(file_buf), fp) != NULL) {
if (*file_buf == '#' || *file_buf == '\n')
continue;
- if (eol = strchr(file_buf, '\n'))
+ if ((eol = strchr(file_buf, '\n')) != NULL)
*eol = NULL;
write_file(file_buf, block_size);
}
@@ -233,7 +233,7 @@
}
void
-cleanup(int dummy)
+cleanup(int dummy __unused)
{
if (ioctl(fd, CDRIOCSETBLOCKSIZE, &saved_block_size) < 0)
err(EX_IOERR, "ioctl(CDRIOCSETBLOCKSIZE)");
@@ -252,7 +252,7 @@
{
int addr, count, file, filesize, size;
char buf[2352*BLOCKS];
- struct stat stat;
+ struct stat filestat;
static int cdopen, done_stdin, tot_size = 0;
if (!strcmp(name, "-")) {
@@ -278,9 +278,9 @@
if (ioctl(fd, CDRIOCNEXTWRITEABLEADDR, &addr) < 0)
err(EX_IOERR, "ioctl(CDRIOCNEXTWRITEABLEADDR)");
- if (fstat(file, &stat) < 0)
+ if (fstat(file, &filestat) < 0)
err(EX_IOERR, "fstat(%s)", name);
- filesize = stat.st_size / 1024;
+ filesize = filestat.st_size / 1024;
if (!quiet) {
fprintf(stderr, "next writeable LBA %d\n", addr);
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107081912.f68JCgP17359>
