summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2001-12-02 13:48:40 +0000
committermarkm <markm@FreeBSD.org>2001-12-02 13:48:40 +0000
commit11e67a93424d6a1809a70fc2ef1afa71e49ea0cd (patch)
tree620c2f4d8cb09dac390014511238b22c1e62b4ac
parentaeb55e91a2e891a1c2315cee7210f70caa798355 (diff)
downloadFreeBSD-src-11e67a93424d6a1809a70fc2ef1afa71e49ea0cd.zip
FreeBSD-src-11e67a93424d6a1809a70fc2ef1afa71e49ea0cd.tar.gz
WARNS=2 fixup
-rw-r--r--usr.bin/doscmd/cpu.c8
-rw-r--r--usr.bin/doscmd/cwd.c4
-rw-r--r--usr.bin/doscmd/cwd.h18
-rw-r--r--usr.bin/doscmd/dos.c2
-rw-r--r--usr.bin/doscmd/doscmd.c4
-rw-r--r--usr.bin/doscmd/ems.c2
-rw-r--r--usr.bin/doscmd/exe.c2
-rw-r--r--usr.bin/doscmd/i386-pinsn.c18
-rw-r--r--usr.bin/doscmd/int13.c2
-rw-r--r--usr.bin/doscmd/intff.c21
-rw-r--r--usr.bin/doscmd/port.c8
-rw-r--r--usr.bin/doscmd/signal.c2
-rw-r--r--usr.bin/doscmd/timer.c6
-rw-r--r--usr.bin/doscmd/tty.c12
-rw-r--r--usr.bin/du/Makefile2
-rw-r--r--usr.bin/du/du.c3
16 files changed, 58 insertions, 56 deletions
diff --git a/usr.bin/doscmd/cpu.c b/usr.bin/doscmd/cpu.c
index ea60ff1..f69af86 100644
--- a/usr.bin/doscmd/cpu.c
+++ b/usr.bin/doscmd/cpu.c
@@ -44,26 +44,26 @@ static void write_word(u_int32_t, u_int16_t);
** Hardware /0 interrupt
*/
void
-int00(regcontext_t *REGS)
+int00(regcontext_t *REGS __unused)
{
debug(D_ALWAYS, "Divide by 0 in DOS program!\n");
exit(1);
}
void
-int01(regcontext_t *REGS)
+int01(regcontext_t *REGS __unused)
{
debug(D_ALWAYS, "INT 1 with no handler! (single-step/debug)\n");
}
void
-int03(regcontext_t *REGS)
+int03(regcontext_t *REGS __unused)
{
debug(D_ALWAYS, "INT 3 with no handler! (breakpoint)\n");
}
void
-int0d(regcontext_t *REGS)
+int0d(regcontext_t *REGS __unused)
{
debug(D_ALWAYS, "IRQ5 with no handler!\n");
}
diff --git a/usr.bin/doscmd/cwd.c b/usr.bin/doscmd/cwd.c
index 85269b9..2e5415a 100644
--- a/usr.bin/doscmd/cwd.c
+++ b/usr.bin/doscmd/cwd.c
@@ -80,7 +80,7 @@ static Name_t *names;
* Initialize the drive to be based at 'base' in the BSD filesystem
*/
void
-init_path(int drive, u_char *base, u_char *dir)
+init_path(int drive, const u_char *base, const u_char *dir)
{
Path_t *d;
@@ -233,7 +233,7 @@ dos_makepath(u_char *where, u_char *newpath)
if (*where != '\\' && *where != '/') {
ustrncpy(tmppath, d->cwd, 1024);
if (d->cwd[1])
- ustrncat(tmppath, (u_char *)"/", 1024 - ustrlen(tmppath));
+ ustrncat(tmppath, "/", 1024 - ustrlen(tmppath));
ustrncat(tmppath, where, 1024 - ustrlen(tmppath));
} else {
ustrncpy(tmppath, where, 1024 - ustrlen(tmppath));
diff --git a/usr.bin/doscmd/cwd.h b/usr.bin/doscmd/cwd.h
index 4e61558..16c7474 100644
--- a/usr.bin/doscmd/cwd.h
+++ b/usr.bin/doscmd/cwd.h
@@ -45,9 +45,9 @@ ustrcat(u_char *s1, u_char *s2)
}
static inline u_char *
-ustrncat(u_char *s1, u_char *s2, size_t n)
+ustrncat(u_char *s1, const u_char *s2, size_t n)
{
- return((u_char *)strncat((char *)s1, (char *)s2, n));
+ return((u_char *)strncat((char *)s1, (const char *)s2, n));
}
static inline u_char *
@@ -63,15 +63,15 @@ ustrcmp(u_char *s1, u_char *s2)
}
static inline int
-ustrncmp(u_char *s1, u_char *s2, size_t n)
+ustrncmp(const u_char *s1, const u_char *s2, size_t n)
{
- return(strncmp((char *)s1, (char *)s2, n));
+ return(strncmp((const char *)s1, (const char *)s2, n));
}
static inline int
-ustrlen(u_char *s)
+ustrlen(const u_char *s)
{
- return(strlen((char *)s));
+ return(strlen((const char *)s));
}
static inline u_char *
@@ -81,9 +81,9 @@ ustrrchr(u_char *s, u_char c)
}
static inline u_char *
-ustrdup(u_char *s)
+ustrdup(const u_char *s)
{
- return((u_char *)strdup((char *)s));
+ return((u_char *)strdup((const char *)s));
}
static inline int
@@ -98,7 +98,7 @@ uaccess(u_char *s, int mode)
return(access((char *)s, mode));
}
-extern void init_path(int, u_char *, u_char *);
+extern void init_path(int, const u_char *, const u_char *);
extern void dos_makereadonly(int);
extern int dos_readonly(int);
extern u_char *dos_getcwd(int);
diff --git a/usr.bin/doscmd/dos.c b/usr.bin/doscmd/dos.c
index 975c3b8..90b0b12 100644
--- a/usr.bin/doscmd/dos.c
+++ b/usr.bin/doscmd/dos.c
@@ -1800,7 +1800,7 @@ int21_57_0(regcontext_t *REGS)
** set mtime for handle
*/
static int
-int21_57_1(regcontext_t *REGS)
+int21_57_1(regcontext_t *REGS __unused)
{
#ifdef __NetBSD__ /* XXX need futimes() */
struct stat sb;
diff --git a/usr.bin/doscmd/doscmd.c b/usr.bin/doscmd/doscmd.c
index f750b81..cec22ee 100644
--- a/usr.bin/doscmd/doscmd.c
+++ b/usr.bin/doscmd/doscmd.c
@@ -399,7 +399,7 @@ setup_command(int argc, char *argv[], regcontext_t *REGS)
p = getcwd(buffer, sizeof(buffer));
if (!p || !*p) p = getenv("PWD");
if (!p || !*p) p = "/";
- init_path(drlton('C'), (u_char *)"/", (u_char *)p);
+ init_path(drlton('C'), "/", p);
/* look for PATH= already set, learn from it if possible */
for (i = 0; i < ecnt; ++i) {
@@ -451,7 +451,7 @@ setup_command(int argc, char *argv[], regcontext_t *REGS)
/* XXX ??? */
if (dos_getcwd(drlton('R')) == NULL)
- init_path(drlton('R'), (u_char *)"/", 0);
+ init_path(drlton('R'), "/", 0);
/* get program name */
strncpy(prog, *argv++, sizeof(prog) -1);
diff --git a/usr.bin/doscmd/ems.c b/usr.bin/doscmd/ems.c
index 2ff21b0..72065f7 100644
--- a/usr.bin/doscmd/ems.c
+++ b/usr.bin/doscmd/ems.c
@@ -1506,7 +1506,7 @@ check_saved_context(EMScontext *emp)
*/
static int
check_alloc_pages(u_short handle, u_short firstpage, u_short offset,
- u_long length)
+ u_long length __unused)
{
u_long nbytes;
diff --git a/usr.bin/doscmd/exe.c b/usr.bin/doscmd/exe.c
index 8e6172b..27ee694 100644
--- a/usr.bin/doscmd/exe.c
+++ b/usr.bin/doscmd/exe.c
@@ -120,7 +120,7 @@ load_com(int fd, int start_segment)
}
static void
-load_exe(int fd, int start_segment, int reloc_segment, struct exehdr *hdr, int text_size)
+load_exe(int fd, int start_segment, int reloc_segment __unused, struct exehdr *hdr, int text_size)
{
char *start_addr;
int reloc_size;
diff --git a/usr.bin/doscmd/i386-pinsn.c b/usr.bin/doscmd/i386-pinsn.c
index 5a7eff7..8b20fac 100644
--- a/usr.bin/doscmd/i386-pinsn.c
+++ b/usr.bin/doscmd/i386-pinsn.c
@@ -1465,13 +1465,13 @@ dofloat ()
}
static void
-OP_ST(int dummy)
+OP_ST(int dummy __unused)
{
oappend ("%st");
}
static void
-OP_STi(int dummy)
+OP_STi(int dummy __unused)
{
sprintf (scratchbuf, "%%st(%d)", rm);
oappend (scratchbuf);
@@ -1834,7 +1834,7 @@ append_pc(unsigned long pc)
}
static void
-OP_SEG(int dummy)
+OP_SEG(int dummy __unused)
{
static const char *sreg[] = {
"%es","%cs","%ss","%ds","%fs","%gs","%?","%?",
@@ -1880,7 +1880,7 @@ OP_DIR(int size)
}
static void
-OP_OFF(int dummy)
+OP_OFF(int dummy __unused)
{
int off;
@@ -1894,7 +1894,7 @@ OP_OFF(int dummy)
}
static void
-OP_ESDI(int dummy)
+OP_ESDI(int dummy __unused)
{
oappend ("%es:(");
oappend (aflag ? "%edi" : "%di");
@@ -1902,7 +1902,7 @@ OP_ESDI(int dummy)
}
static void
-OP_DSSI(int dummy)
+OP_DSSI(int dummy __unused)
{
oappend ("%ds:(");
oappend (aflag ? "%esi" : "%si");
@@ -1910,7 +1910,7 @@ OP_DSSI(int dummy)
}
static void
-OP_C(int dummy)
+OP_C(int dummy __unused)
{
codep++; /* skip mod/rm */
sprintf (scratchbuf, "%%cr%d", reg);
@@ -1918,7 +1918,7 @@ OP_C(int dummy)
}
static void
-OP_D(int dummy)
+OP_D(int dummy __unused)
{
codep++; /* skip mod/rm */
sprintf (scratchbuf, "%%db%d", reg);
@@ -1926,7 +1926,7 @@ OP_D(int dummy)
}
static void
-OP_T(int dummy)
+OP_T(int dummy __unused)
{
codep++; /* skip mod/rm */
sprintf (scratchbuf, "%%tr%d", reg);
diff --git a/usr.bin/doscmd/int13.c b/usr.bin/doscmd/int13.c
index e10bf51..039a641 100644
--- a/usr.bin/doscmd/int13.c
+++ b/usr.bin/doscmd/int13.c
@@ -244,7 +244,7 @@ init_hdisk(int drive, int cyl, int head, int tracksize, char *file, char *fake_p
for (fd = 0; fd < 4; ++fd) {
if (*(u_short *)(di->sector0 + 0x1FE) == 0xAA55 &&
- ptab[fd].numSectors == head * tracksize * cyl &&
+ ptab[fd].numSectors == (u_long)(head * tracksize * cyl) &&
(ptab[fd].systemID == 1 || ptab[fd].systemID == 4 ||
ptab[fd].systemID == 6))
break;
diff --git a/usr.bin/doscmd/intff.c b/usr.bin/doscmd/intff.c
index 7e608cf..5586c4e 100644
--- a/usr.bin/doscmd/intff.c
+++ b/usr.bin/doscmd/intff.c
@@ -139,7 +139,7 @@ int2f11_dirfn(regcontext_t *REGS)
** Close
*/
static int
-int2f11_close(regcontext_t *REGS)
+int2f11_close(regcontext_t *REGS __unused)
{
int fd;
@@ -162,7 +162,7 @@ int2f11_close(regcontext_t *REGS)
** read/write
*/
static int
-int2f11_rdwr(regcontext_t *REGS)
+int2f11_rdwr(regcontext_t *REGS __unused)
{
int fd;
char *addr;
@@ -207,7 +207,7 @@ int2f11_rdwr(regcontext_t *REGS)
** Get free space (like 21:36)
*/
static int
-int2f11_free(regcontext_t *REGS)
+int2f11_free(regcontext_t *REGS __unused)
{
fsstat_t fs;
int error;
@@ -228,7 +228,7 @@ int2f11_free(regcontext_t *REGS)
** get size and mode
*/
static int
-int2f11_stat(regcontext_t *REGS)
+int2f11_stat(regcontext_t *REGS __unused)
{
char fname[PATH_MAX];
struct stat sb;
@@ -421,7 +421,7 @@ int2f11_open(regcontext_t *REGS)
** find first
*/
static int
-int2f11_findfirst(regcontext_t *REGS)
+int2f11_findfirst(regcontext_t *REGS __unused)
{
return(find_first(sda->filename1,sda->attrmask,
(dosdir_t *)sda->foundentry,
@@ -434,7 +434,7 @@ int2f11_findfirst(regcontext_t *REGS)
** find next
*/
static int
-int2f11_findnext(regcontext_t *REGS)
+int2f11_findnext(regcontext_t *REGS __unused)
{
return(find_next((dosdir_t *)sda->foundentry,
(find_block_t *)sda->findfirst));
@@ -477,7 +477,8 @@ static int
int2f11_fnqual(regcontext_t *REGS)
{
char *fname;
- const char *tname;
+ char *tname;
+ static char errmsg[] = "(failed)";
int savedrive;
int error;
@@ -490,7 +491,7 @@ int2f11_fnqual(regcontext_t *REGS)
error = dos_makepath(fname, tname);
if (error)
- tname = "(failed)";
+ tname = errmsg;
diskdrive = savedrive; /* restore correct drive */
@@ -504,7 +505,7 @@ int2f11_fnqual(regcontext_t *REGS)
** Null function - we know about it but do nothing
*/
static int
-int2f11_NULLFUNC(regcontext_t *REGS)
+int2f11_NULLFUNC(regcontext_t *REGS __unused)
{
return(0);
}
@@ -515,7 +516,7 @@ int2f11_NULLFUNC(regcontext_t *REGS)
** no function - not handled here (error)
*/
static int
-int2f11_NOFUNC(regcontext_t *REGS)
+int2f11_NOFUNC(regcontext_t *REGS __unused)
{
return(-1);
}
diff --git a/usr.bin/doscmd/port.c b/usr.bin/doscmd/port.c
index 5fcd3a10..9b26836 100644
--- a/usr.bin/doscmd/port.c
+++ b/usr.bin/doscmd/port.c
@@ -178,7 +178,7 @@ inb_port(int port)
*/
static void
-outb_nullport(int port, unsigned char byte)
+outb_nullport(int port __unused, unsigned char byte __unused)
{
/*
debug(D_PORT, "outb_nullport called for port 0x%03X = 0x%02X.\n",
@@ -187,7 +187,7 @@ outb_nullport(int port, unsigned char byte)
}
static unsigned char
-inb_nullport(int port)
+inb_nullport(int port __unused)
{
/*
debug(D_PORT, "inb_nullport called for port 0x%03X.\n", port);
@@ -405,7 +405,7 @@ int sound_on = 1;
int sound_freq = 1000;
void
-outb_speaker(int port, unsigned char byte)
+outb_speaker(int port __unused, unsigned char byte)
{
#if 0 /*XXXXX*/
if (raw_kbd) {
@@ -420,7 +420,7 @@ outb_speaker(int port, unsigned char byte)
}
unsigned char
-inb_speaker(int port)
+inb_speaker(int port __unused)
{
/* port_61 = (port_61 + 1) & 0xff; */
return(port_61);
diff --git a/usr.bin/doscmd/signal.c b/usr.bin/doscmd/signal.c
index 11f669b..b0de9b9 100644
--- a/usr.bin/doscmd/signal.c
+++ b/usr.bin/doscmd/signal.c
@@ -44,7 +44,7 @@ regcontext_t *saved_regcontext;
int saved_valid = 0;
static void
-sanity_check(struct sigframe *sf)
+sanity_check(struct sigframe *sf __unused)
{
#if 0
static sigset_t oset;
diff --git a/usr.bin/doscmd/timer.c b/usr.bin/doscmd/timer.c
index 29a6915..d2eec93 100644
--- a/usr.bin/doscmd/timer.c
+++ b/usr.bin/doscmd/timer.c
@@ -6,7 +6,7 @@
#include "doscmd.h"
static void
-int08(regcontext_t *REGS)
+int08(regcontext_t *REGS __unused)
{
*(u_long *)&BIOSDATA[0x6c] += 1; /* ticks since midnight */
while (*(u_long *)&BIOSDATA[0x6c] >= 24*60*6*182) {
@@ -19,14 +19,14 @@ int08(regcontext_t *REGS)
}
static void
-int1c(regcontext_t *REGS)
+int1c(regcontext_t *REGS __unused)
{
}
unsigned char timer;
static u_char
-inb_timer(int port)
+inb_timer(int port __unused)
{
return (--timer);
}
diff --git a/usr.bin/doscmd/tty.c b/usr.bin/doscmd/tty.c
index 41e9792..2a2ae39 100644
--- a/usr.bin/doscmd/tty.c
+++ b/usr.bin/doscmd/tty.c
@@ -198,7 +198,7 @@ static void vram2ximage(void);
#define K4_ERROR 0x80
static void
-Failure(void *arg)
+Failure(void *arg __unused)
{
fprintf(stderr, "X Connection shutdown\n");
quit(1);
@@ -234,7 +234,7 @@ console_denit(void *arg)
}
void
-_kbd_event(int fd, int cond, void *arg, regcontext_t *REGS)
+_kbd_event(int fd, int cond, void *arg __unused, regcontext_t *REGS __unused)
{
if (!(cond & AS_RD))
return;
@@ -352,7 +352,7 @@ setgc(u_short attr)
}
void
-video_update(regcontext_t *REGS)
+video_update(regcontext_t *REGS __unused)
{
#ifndef NO_X
static int icnt = 3;
@@ -769,7 +769,7 @@ debug_event(int fd, int cond, void *arg, regcontext_t *REGS)
}
unsigned char
-inb_port60(int port)
+inb_port60(int port __unused)
{
int r = break_code;
break_code = 0;
@@ -791,7 +791,7 @@ kbd_event(int fd, int cond, void *arg, regcontext_t *REGS)
}
void
-int09(REGISTERS)
+int09(REGISTERS __unused)
{
if (raw_kbd) {
if (scan_code != 0xffff) {
@@ -2210,7 +2210,7 @@ update_pixels()
}
void
-write_vram(void *arg)
+write_vram(void *arg __unused)
{
int fd;
diff --git a/usr.bin/du/Makefile b/usr.bin/du/Makefile
index 863e392..d279a97 100644
--- a/usr.bin/du/Makefile
+++ b/usr.bin/du/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PROG= du
-CFLAGS+= -Wall
+WARNS?= 2
DPADD= ${LIBM}
LDADD= -lm
diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c
index 8595341..9d44963 100644
--- a/usr.bin/du/du.c
+++ b/usr.bin/du/du.c
@@ -117,6 +117,7 @@ main(argc, argv)
int depth;
int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag, hflag, ch, notused, rval;
char **save;
+ static char dot[] = ".";
Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = 0;
@@ -225,7 +226,7 @@ main(argc, argv)
if (!*argv) {
argv = save;
- argv[0] = ".";
+ argv[0] = dot;
argv[1] = NULL;
}
OpenPOWER on IntegriCloud