From: Sascha Wildner Date: Fri, 1 May 2009 20:00:12 +0000 (+0200) Subject: doscmd(1): Raise WARNS to 6 and silence all warnings. X-Git-Tag: v2.3.1~30 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/a62ce081425c70de9d2274fdaf09f05e33b73ca4 doscmd(1): Raise WARNS to 6 and silence all warnings. --- diff --git a/usr.bin/doscmd/Makefile b/usr.bin/doscmd/Makefile index 5b102c9106..23c5a425f8 100644 --- a/usr.bin/doscmd/Makefile +++ b/usr.bin/doscmd/Makefile @@ -21,7 +21,6 @@ EXEGRP:= ${BINGRP} EXEMODE= ${NOBINMODE} #BINGRP= kmem #BINMODE= 2555 -WARNS?= 0 .if !defined(NO_X) && exists(${XINCDIR}/X11/X.h) && exists(${XLIBDIR}/libX11.a) CFLAGS+= -I${XINCDIR} diff --git a/usr.bin/doscmd/ParseBuffer.c b/usr.bin/doscmd/ParseBuffer.c index 87d3ebcb19..8d0f549eb6 100644 --- a/usr.bin/doscmd/ParseBuffer.c +++ b/usr.bin/doscmd/ParseBuffer.c @@ -41,7 +41,7 @@ int ParseBuffer(char *obuf, char **av, int mac) { static char *_buf; - char *buf; + char *buf = NULL; static int buflen = 0; int len; diff --git a/usr.bin/doscmd/cmos.c b/usr.bin/doscmd/cmos.c index ef7077ba55..578d0ab2ac 100644 --- a/usr.bin/doscmd/cmos.c +++ b/usr.bin/doscmd/cmos.c @@ -128,10 +128,10 @@ from_BCD (int n) static unsigned char cmos_inb(int portnum) { - unsigned char ret_val; + unsigned char ret_val = 0; int cmos_reg; struct timezone tz; - struct tm tm; + struct tm tm = { .tm_sec = 0 }; time_t now; switch (portnum) { @@ -183,7 +183,7 @@ cmos_outb(int portnum, unsigned char byte) int year; int time00; struct timezone tz; - struct tm tm; + struct tm tm = { .tm_sec = 0 }; time_t now; switch (portnum) { diff --git a/usr.bin/doscmd/config.c b/usr.bin/doscmd/config.c index e3e105436f..1f0ba5525c 100644 --- a/usr.bin/doscmd/config.c +++ b/usr.bin/doscmd/config.c @@ -260,7 +260,7 @@ init_hard: define_output_port_handler(p++, outb_port); } } else if (!strcasecmp(av[0], "setver")) { - int v; + int v = 0; if (ac != 3 || !(v = strtol(av[2], 0, 0))) { fprintf(stderr, "Usage: setver command version\n"); quit(1); diff --git a/usr.bin/doscmd/dos.c b/usr.bin/doscmd/dos.c index 72eaa394f8..8fcba510dd 100644 --- a/usr.bin/doscmd/dos.c +++ b/usr.bin/doscmd/dos.c @@ -156,7 +156,7 @@ int21_free(regcontext_t *REGS) { fsstat_t fs; int error; - int drive; + int drive = 0; /* work out drive */ switch (R_AH) { @@ -1128,8 +1128,8 @@ int21_open(regcontext_t *REGS) int error; char fname[PATH_MAX]; struct stat sb; - int mode,action,status; - char *pname; + int mode = 0, action = 0, status; + char *pname = NULL; int drive; int fd; @@ -1743,7 +1743,7 @@ int21_find(regcontext_t *REGS) { find_block_t *dta; dosdir_t dosdir; - int error; + int error = 0; dta = (find_block_t *)VECPTR(disk_transfer_addr); diff --git a/usr.bin/doscmd/ems.c b/usr.bin/doscmd/ems.c index 95cfd9173e..d5d1047313 100644 --- a/usr.bin/doscmd/ems.c +++ b/usr.bin/doscmd/ems.c @@ -789,8 +789,8 @@ ems_entry(regcontext_t *REGS) case MOVE_MEMORY_REGION: { EMSmovemem *emvp; - u_long src_addr, dst_addr; - u_short src_handle, dst_handle; + u_long src_addr = 0, dst_addr = 0; + u_short src_handle = 0, dst_handle = 0; if (R_AL == EXCHANGE) debug(D_EMS, "EMS: Exchange memory region "); diff --git a/usr.bin/doscmd/exe.c b/usr.bin/doscmd/exe.c index 9a4d7f6a25..f94521522f 100644 --- a/usr.bin/doscmd/exe.c +++ b/usr.bin/doscmd/exe.c @@ -165,7 +165,7 @@ load_command(regcontext_t *REGS, int run, int fd, char *cmd_name, int biggest; int envseg; char *psp; - int text_size; + int text_size = 0; int i; int start_segment; int exe_file; diff --git a/usr.bin/doscmd/i386-pinsn.c b/usr.bin/doscmd/i386-pinsn.c index 62e993b376..01d59251eb 100644 --- a/usr.bin/doscmd/i386-pinsn.c +++ b/usr.bin/doscmd/i386-pinsn.c @@ -1550,9 +1550,9 @@ OP_E(int bytemode) { int disp; int havesib; - int base; - int idx; - int scale; + int base = 0; + int idx = 0; + int scale = 0; int havebase; /* skip mod/rm byte */ diff --git a/usr.bin/doscmd/int.c b/usr.bin/doscmd/int.c index 7e37c8594d..32e89dc4d9 100644 --- a/usr.bin/doscmd/int.c +++ b/usr.bin/doscmd/int.c @@ -170,26 +170,26 @@ unpend(int irql) } static unsigned char -irqc_in(int port) +irqc_in(int port __unused) { return 0x60; /* What should be here? */ } static void -irqc_out(int port, unsigned char val) +irqc_out(int port __unused, unsigned char val) { if (val == 0x20) send_eoi(); } static unsigned char -imr_in(int port) +imr_in(int port __unused) { return IM; } static void -imr_out(int port, unsigned char val) +imr_out(int port __unused, unsigned char val) { IM = val; resume_interrupt(); diff --git a/usr.bin/doscmd/int13.c b/usr.bin/doscmd/int13.c index 50cd9122cc..b8a124d907 100644 --- a/usr.bin/doscmd/int13.c +++ b/usr.bin/doscmd/int13.c @@ -190,7 +190,7 @@ int init_hdisk(int drive, int cyl, int head, int tracksize, char *file, char *fake_ptab) { struct diskinfo *di; - u_long table; + u_long table = 0; if (drive < 0) { for (drive = 2; drive < 26; ++drive) { @@ -355,7 +355,7 @@ int init_floppy(int drive, int type, char *file) { struct diskinfo *di = floppyinfo; - u_long table; + u_long table = 0; struct stat sb; while (di->type >= 0 && di->type != type && disize(di)/2 != type) diff --git a/usr.bin/doscmd/int14.c b/usr.bin/doscmd/int14.c index 4a72d2aba1..bed7cc36c0 100644 --- a/usr.bin/doscmd/int14.c +++ b/usr.bin/doscmd/int14.c @@ -238,7 +238,7 @@ get_int_id(struct com_data_struct *cdsp) } static void -com_async(int fd, int cond, void *arg, regcontext_t *REGS) +com_async(int fd __unused, int cond, void *arg, regcontext_t *REGS __unused) { struct com_data_struct *cdsp = (struct com_data_struct*) arg; @@ -331,7 +331,7 @@ com_set_line(struct com_data_struct *cdsp, unsigned char port, unsigned char par { struct stat stat_buf; int mode = 0; /* read | write */ - int reg_num, ret_val, spd, speed; + int reg_num, ret_val, spd = 0, speed = 0; u_int8_t div_hi, div_lo; debug(D_PORT, "com_set_line: cdsp = %8p, port = 0x%04x," @@ -526,8 +526,8 @@ init_com(int port, char *path, int addr, unsigned char irq) unsigned char com_port_in(int port) { - struct com_data_struct *cdsp; - unsigned char rs; + struct com_data_struct *cdsp = NULL; + unsigned char rs = 0; unsigned char i; int r; @@ -606,7 +606,7 @@ com_port_in(int port) void com_port_out(int port, unsigned char val) { - struct com_data_struct *cdsp; + struct com_data_struct *cdsp = NULL; int i; /* search for a valid COM ???or MOUSE??? port */ diff --git a/usr.bin/doscmd/intff.c b/usr.bin/doscmd/intff.c index 930f7f9d6b..3a900cb497 100644 --- a/usr.bin/doscmd/intff.c +++ b/usr.bin/doscmd/intff.c @@ -168,7 +168,7 @@ int2f11_rdwr(regcontext_t *REGS __unused) int fd; char *addr; int nbytes; - int n; + int n = 0; fd = r_sft->fd; if (lseek(fd, r_sft->offset, SEEK_SET) < 0) @@ -259,12 +259,12 @@ int2f11_open(regcontext_t *REGS) char fname[PATH_MAX]; struct stat sb; int error; - int mode; /* open mode */ + int mode = 0; /* open mode */ int attr; /* attributes of created file */ - int action; /* what to do about file */ + int action = 0; /* what to do about file */ u_char *p, *e; int i; - int omode; /* mode to say we opened in */ + int omode = 0; /* mode to say we opened in */ int status; int fd; diff --git a/usr.bin/doscmd/mouse.c b/usr.bin/doscmd/mouse.c index 2614107687..41fa93f8f8 100644 --- a/usr.bin/doscmd/mouse.c +++ b/usr.bin/doscmd/mouse.c @@ -48,7 +48,7 @@ mouse_probe(void) void int33(regcontext_t *REGS) { - u_long vec; + u_long vec = 0; u_short mask; int i; diff --git a/usr.bin/doscmd/tty.c b/usr.bin/doscmd/tty.c index 6f00011845..09860d85b1 100644 --- a/usr.bin/doscmd/tty.c +++ b/usr.bin/doscmd/tty.c @@ -640,7 +640,7 @@ struct { }; void -debug_event(int fd, int cond, void *arg, regcontext_t *REGS) +debug_event(int fd __unused, int cond, void *arg __unused, regcontext_t *REGS) { static char ibuf[1024]; static int icnt = 0; @@ -769,7 +769,7 @@ inb_port60(int port __unused) } 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; @@ -970,7 +970,8 @@ printf("FORCED REDRAW\n"); } void -video_async_event(int fd, int cond, void *arg, regcontext_t *REGS) +video_async_event(int fd, int cond, void *arg __unused, + regcontext_t *REGS __unused) { #ifndef NO_X int int9 = 0; @@ -1674,7 +1675,7 @@ tty_read(REGISTERS, int flag) int tty_peek(REGISTERS, int flag) { - int c; + int c = 0; if (c == nextchar) return(nextchar & 0xff);