From: millert Date: Sat, 21 Dec 1996 22:23:36 +0000 (+0000) Subject: -Wall madness. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=07ea8d1515ffde9f9d310504e9c8852d6bf7074c;p=openbsd -Wall madness. --- diff --git a/lib/csu/i386/crt0.c b/lib/csu/i386/crt0.c index 9ec7585fa74..d38f3bced66 100644 --- a/lib/csu/i386/crt0.c +++ b/lib/csu/i386/crt0.c @@ -1,4 +1,6 @@ +/* $OpenBSD: crt0.c,v 1.2 1996/12/21 22:23:36 millert Exp $ */ /* $NetBSD: crt0.c,v 1.20 1995/06/03 13:16:08 pk Exp $ */ + /* * Copyright (c) 1993 Paul Kranenburg * All rights reserved. @@ -67,7 +69,7 @@ start() argv = &kfp->kargv[0]; environ = argv + kfp->kargc + 1; - if (ap = argv[0]) + if ((ap = argv[0])) if ((__progname = _strrchr(ap, '/')) == NULL) __progname = ap; else diff --git a/lib/libc/compat-43/getwd.c b/lib/libc/compat-43/getwd.c index 12880a9c49c..e6f0d0053b7 100644 --- a/lib/libc/compat-43/getwd.c +++ b/lib/libc/compat-43/getwd.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: getwd.c,v 1.3 1996/12/17 02:38:39 deraadt Exp $"; +static char *rcsid = "$OpenBSD: getwd.c,v 1.4 1996/12/21 22:23:37 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -47,7 +47,7 @@ getwd(buf) { char *p; - if (p = getcwd(buf, MAXPATHLEN)) + if ((p = getcwd(buf, MAXPATHLEN))) return(p); (void)strncpy(buf, strerror(errno), MAXPATHLEN-1); buf[MAXPATHLEN-1] = '\0'; diff --git a/lkm/ap/aperture.c b/lkm/ap/aperture.c index 09de3223ffb..89543c1f386 100644 --- a/lkm/ap/aperture.c +++ b/lkm/ap/aperture.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aperture.c,v 1.1 1996/03/05 11:25:29 mickey Exp $ */ +/* $OpenBSD: aperture.c,v 1.2 1996/12/21 22:23:38 millert Exp $ */ /* * Copyright 1994 the XFree86 Project Inc. @@ -25,8 +25,6 @@ static int ap_open_count = 0; int apopen(dev_t dev, int oflags, int devtype, struct proc *p) { - struct pcred *pc = p->p_cred; - if (suser(p->p_ucred, &p->p_acflag) != 0) { return(EPERM); } @@ -64,7 +62,7 @@ apmmap(dev_t dev, int offset, int length) printf("apmmap: addr 0x%x\n", offset); #endif if ((minor(dev) == 0) - && (offset >= VGA_START && offset <= VGA_END + && ((offset >= VGA_START && offset <= VGA_END) || (unsigned)offset > (unsigned)ctob(physmem))) { return i386_btop(offset); } else { diff --git a/lkm/ap/aptest/aptest.c b/lkm/ap/aptest/aptest.c index ed73cdd28ab..5dcccfb9d39 100644 --- a/lkm/ap/aptest/aptest.c +++ b/lkm/ap/aptest/aptest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aptest.c,v 1.1 1996/03/05 11:25:46 mickey Exp $ */ +/* $OpenBSD: aptest.c,v 1.2 1996/12/21 22:23:39 millert Exp $ */ /* * Copyright 1994 Doug Anson, danson@lgc.com & David Holland, davidh@use.com * @@ -108,7 +108,7 @@ int main(int argc,char **argv) printf("%c",addr[i]); /* printf("addr[%d]=%c\n",i,addr[i]); */ - printf("\nDONE displaying memory contents (%d bytes)\n",stop); + printf("\nDONE displaying memory contents (%ld bytes)\n",stop); /* unmap and close */ printf("UNMAPPING [0x%x ,size=%d) to addr=0x%x... and closing...", diff --git a/regress/include/bitstring/bitstring_test.c b/regress/include/bitstring/bitstring_test.c index d30bd8982af..3fa2511e59e 100644 --- a/regress/include/bitstring/bitstring_test.c +++ b/regress/include/bitstring/bitstring_test.c @@ -26,11 +26,12 @@ int TEST_LENGTH; #define DECL_TEST_LENGTH 37 /* a mostly random number */ +int main(int argc, char *argv[]) { void clearbits(); void printbits(); - int b, i; + int i; bitstr_t *bs; bitstr_t bit_decl(bss, DECL_TEST_LENGTH); diff --git a/regress/lib/libc/ieeefp/except/except.c b/regress/lib/libc/ieeefp/except/except.c index 0ffdcdd468f..a2a107a788d 100644 --- a/regress/lib/libc/ieeefp/except/except.c +++ b/regress/lib/libc/ieeefp/except/except.c @@ -12,6 +12,7 @@ static volatile const double zero = 0.0; static volatile const double huge = DBL_MAX; static volatile const double tiny = DBL_MIN; +int main() { volatile double x; diff --git a/regress/lib/libc/regex/debug.c b/regress/lib/libc/regex/debug.c index 861f550611e..41cd4a557d6 100644 --- a/regress/lib/libc/regex/debug.c +++ b/regress/lib/libc/regex/debug.c @@ -218,7 +218,7 @@ FILE *d; fprintf(d, ">"); break; default: - fprintf(d, "!%d(%d)!", OP(*s), opnd); + fprintf(d, "!%ld(%ld)!", (long)OP(*s), (long)opnd); break; } if (!done) diff --git a/regress/lib/libc/regex/main.c b/regress/lib/libc/regex/main.c index 8d88a8b9b81..add5e8be103 100644 --- a/regress/lib/libc/regex/main.c +++ b/regress/lib/libc/regex/main.c @@ -1,10 +1,13 @@ +/* $OpenBSD: main.c,v 1.2 1996/12/21 22:23:42 millert Exp $ */ /* $NetBSD: main.c,v 1.2 1995/04/20 22:39:51 cgd Exp $ */ #include +#include #include #include #include #include +#include #include "main.ih" @@ -25,6 +28,7 @@ extern void regprint(); /* - main - do the simple case, hand off to regress() for regression */ +int main(argc, argv) int argc; char *argv[]; @@ -102,10 +106,10 @@ char *argv[]; exit(status); } if (!(copts®_NOSUB)) { - len = (int)(subs[0].rm_eo - subs[0].rm_so); + len = (size_t)(subs[0].rm_eo - subs[0].rm_so); if (subs[0].rm_so != -1) { if (len != 0) - printf("match `%.*s'\n", len, + printf("match `%.*s'\n", (int)len, argv[optind] + subs[0].rm_so); else printf("match `'@%.1s\n", @@ -501,7 +505,6 @@ efind(name) char *name; { static char efbuf[100]; - size_t n; regex_t re; sprintf(efbuf, "REG_%s", name); diff --git a/regress/lib/libc/setjmp/jmptest.c b/regress/lib/libc/setjmp/jmptest.c index f2cecc9178e..c306979b3d2 100644 --- a/regress/lib/libc/setjmp/jmptest.c +++ b/regress/lib/libc/setjmp/jmptest.c @@ -32,6 +32,7 @@ */ #include +#include #include #include #include diff --git a/regress/sys/kern/execve/doexec.c b/regress/sys/kern/execve/doexec.c index 6ea31d5a636..1f16572979d 100644 --- a/regress/sys/kern/execve/doexec.c +++ b/regress/sys/kern/execve/doexec.c @@ -49,4 +49,6 @@ main(argc, argv) printf("%s\n", strerror(errno)); exit(1); } + + exit(0); } diff --git a/sys/arch/i386/isa/pcvt/Util/cursor/cursor.c b/sys/arch/i386/isa/pcvt/Util/cursor/cursor.c index d455e94ceb4..82231e4f0ea 100644 --- a/sys/arch/i386/isa/pcvt/Util/cursor/cursor.c +++ b/sys/arch/i386/isa/pcvt/Util/cursor/cursor.c @@ -44,13 +44,19 @@ static char *id = * *---------------------------------------------------------------------------*/ -#include #include +#include +#include +#include +#include #include #include #define DEFAULTFD 0 +void usage __P((void)); + +int main(argc,argv) int argc; char *argv[]; @@ -66,7 +72,7 @@ char *argv[]; int start = -1; int end = -1; int dflag = -1; - char *device; + char *device = NULL; while( (c = getopt(argc, argv, "d:n:s:e:")) != EOF) { @@ -144,6 +150,7 @@ char *argv[]; exit(0); } +void usage() { fprintf(stderr,"\ncursor - set cursor shape for pcvt video driver\n"); @@ -154,4 +161,3 @@ usage() fprintf(stderr," -e ending scan line (bottom scan line)\n\n"); exit(1); } - diff --git a/sys/arch/i386/isa/pcvt/Util/fed/misc.c b/sys/arch/i386/isa/pcvt/Util/fed/misc.c index a0dff32703a..80a726261c2 100644 --- a/sys/arch/i386/isa/pcvt/Util/fed/misc.c +++ b/sys/arch/i386/isa/pcvt/Util/fed/misc.c @@ -129,7 +129,7 @@ void readfont(char *filename) break; default: - fprintf(stderr,"error, file %s is no valid font file, size=%d\n",filename,sbp->st_size); + fprintf(stderr,"error, file %s is no valid font file, size=%ld\n",filename,(long)sbp->st_size); exit(1); } @@ -144,7 +144,7 @@ void readfont(char *filename) if((ret = fread(fonttab, sizeof(*fonttab), sbp->st_size, in)) != sbp->st_size) { - sprintf(buffer,"error reading file %s, size = %d, ret = %d\n",filename,sbp->st_size, ret); + sprintf(buffer,"error reading file %s, size = %ld, ret = %d\n",filename,(long)sbp->st_size, ret); perror(buffer); exit(1); } diff --git a/sys/arch/i386/isa/pcvt/Util/fontedit/fontedit.c b/sys/arch/i386/isa/pcvt/Util/fontedit/fontedit.c index 85f96bc9162..ccb0319c5e8 100644 --- a/sys/arch/i386/isa/pcvt/Util/fontedit/fontedit.c +++ b/sys/arch/i386/isa/pcvt/Util/fontedit/fontedit.c @@ -35,6 +35,8 @@ void clear_screen(); #include #endif /* __NetBSD__ || __OpenBSD__ || __FreeBSD__ */ #include +#include +#include #ifdef CURFIX #define CURSORON "\033[?25h" @@ -112,12 +114,32 @@ struct termios old_stty, new_stty; #endif /* __NetBSD__ || __OpenBSD__ || __FreeBSD__ */ FILE * font_file = (FILE *)0; +#ifdef __P +void interrupt __P((void)); +void command __P((void)); +int get_key __P((void)); +void pad __P((void)); +void init_restore __P((void)); +void draw_current __P((void)); +void highlight __P((unsigned int, unsigned int, bool)); +void clear_screen __P((void)); +void move __P((int, int)); +void build_entry __P((unsigned int)); +void extract_entry __P((unsigned int)); +void send_entry __P((int)); +void print_entry __P((register unsigned int, bool)); +void save_table __P((FILE *)); +void get_table __P((FILE *)); +void help __P((void)); +void warning __P((char *)); +#endif /* * Interrupt * Exit gracefully. */ +void interrupt() { void clear_screen(); @@ -143,6 +165,7 @@ interrupt() * Grab input/output file and call main command processor. */ +int main( argc, argv ) int argc; char *argv[]; @@ -231,6 +254,7 @@ char *argv[]; #ifdef CURFIX printf("%s\n",CURSORON); #endif CURFIX + exit(0); } @@ -501,6 +525,7 @@ get_key() * Emit nulls so that the terminal can catch up. */ +void pad() { int i; @@ -668,6 +693,7 @@ clear_screen() * move */ +void move( y, x ) int y, x; { diff --git a/sys/arch/i386/isa/pcvt/Util/ispcvt/ispcvt.c b/sys/arch/i386/isa/pcvt/Util/ispcvt/ispcvt.c index 15c28fe54ba..8520c321d9e 100644 --- a/sys/arch/i386/isa/pcvt/Util/ispcvt/ispcvt.c +++ b/sys/arch/i386/isa/pcvt/Util/ispcvt/ispcvt.c @@ -54,12 +54,19 @@ static char *id = * *---------------------------------------------------------------------------*/ -#include #include +#include +#include +#include +#include #include #define DEFAULTFD 0 +void next __P((void)); +void usage __P((void)); + +int main(argc,argv) int argc; char *argv[]; @@ -76,7 +83,7 @@ char *argv[]; int config = 0; int dflag = 0; int fd; - char *device; + char *device = NULL; while( (c = getopt(argc, argv, "vcd:")) != EOF) { @@ -277,10 +284,12 @@ char *argv[]; fprintf(stderr,"BSD Version = %u\n", pcvtinfo.opsys); fprintf(stderr,"PCVT_NSCREENS = %u\n", pcvtinfo.nscreens); fprintf(stderr,"PCVT_SYSBEEPF = %u\n", pcvtinfo.sysbeepf); - fprintf(stderr,"Compile options = 0x%08X\n", pcvtinfo.compile_opts); + fprintf(stderr,"Compile options = 0x%08X\n", (unsigned int)pcvtinfo.compile_opts); } + exit(0); } +void usage() { fprintf(stderr,"\nispcvt - verify current video driver is the pcvt-driver\n"); @@ -291,6 +300,7 @@ usage() exit(5); } +void next() { static int i = 0; diff --git a/sys/arch/i386/isa/pcvt/Util/kcon/kcon.c b/sys/arch/i386/isa/pcvt/Util/kcon/kcon.c index 663faa9b4ca..ba2b21334ef 100644 --- a/sys/arch/i386/isa/pcvt/Util/kcon/kcon.c +++ b/sys/arch/i386/isa/pcvt/Util/kcon/kcon.c @@ -57,8 +57,11 @@ static char *id = * *---------------------------------------------------------------------------*/ +#include #include +#include #include +#include #include #include #include @@ -76,9 +79,20 @@ int tf = 0; int xf = 0; int sf = 0; +void usage __P((void)); +void showtypeamatic __P((int)); +void listcurrent __P((int)); +void setrepeat __P((int, int)); +void settypeam __P((int, int, int)); +void remapkeys __P((int, char *)); +void set_lock __P((char keyflag[], int)); +void set_shift __P((char keyflag[], int)); +void set_char __P((char keyflag[], int)); + /*---------------------------------------------------------------------------* * main entry *---------------------------------------------------------------------------*/ +int main(argc, argv) int argc; char *argv[]; @@ -92,7 +106,7 @@ char *argv[]; int rate = -1; int delay = -1; - char *map; + char *map = NULL; int kbfd; while((c = getopt(argc, argv, "Rd:lm:opr:st:x")) != EOF) @@ -222,6 +236,7 @@ char *argv[]; /*---------------------------------------------------------------------------* * display usage info & exit *---------------------------------------------------------------------------*/ +void usage() { fprintf(stderr, "\nkcon: keyboard control and remapping utility for pcvt video driver\n"); @@ -242,7 +257,8 @@ usage() /*---------------------------------------------------------------------------* * convert control char in string to printable values *---------------------------------------------------------------------------*/ -char *showcntrl(s) +char * +showcntrl(s) u_char *s; { static char res_str[80]; @@ -278,6 +294,7 @@ u_char *s; /*---------------------------------------------------------------------------* * list the current keyboard mapping *---------------------------------------------------------------------------*/ +void listcurrent(kbfd) int kbfd; { @@ -391,6 +408,7 @@ int kbfd; /*---------------------------------------------------------------------------* * show delay and rate values for keyboard *---------------------------------------------------------------------------*/ +void showtypeamatic(kbfd) int kbfd; { @@ -456,6 +474,7 @@ int kbfd; /*---------------------------------------------------------------------------* * set repeat feature on/off *---------------------------------------------------------------------------*/ +void setrepeat(kbfd, tf) int kbfd; int tf; @@ -477,6 +496,7 @@ int tf; /*---------------------------------------------------------------------------* * set delay and rate values for keyboard *---------------------------------------------------------------------------*/ +void settypeam(kbfd, delay, rate) int kbfd; int delay; @@ -513,6 +533,7 @@ int rate; /*---------------------------------------------------------------------------* * remap keyboard from keycap entry *---------------------------------------------------------------------------*/ +void remapkeys(kbfd, map) int kbfd; char *map; @@ -563,11 +584,12 @@ char *map; /*---------------------------------------------------------------------------* * care for lock keys *---------------------------------------------------------------------------*/ +void set_lock(keyflag, kbfd) char keyflag[]; int kbfd; { - int i, j; + int i; char cap[16]; struct kbd_ovlkey entry; @@ -576,10 +598,10 @@ int kbfd; u_short typ; } lock[] = { - "ca", KBD_CAPS, - "sh", KBD_SHFTLOCK, - "nl", KBD_NUMLOCK, - "sc", KBD_SCROLL + { "ca", KBD_CAPS }, + { "sh", KBD_SHFTLOCK }, + { "nl", KBD_NUMLOCK }, + { "sc", KBD_SCROLL } }; @@ -615,6 +637,7 @@ int kbfd; /*---------------------------------------------------------------------------* * care for shifting keys *---------------------------------------------------------------------------*/ +void set_shift(keyflag, kbfd) char keyflag[]; int kbfd; @@ -628,10 +651,10 @@ int kbfd; u_short typ; } shift[] = { - 'm', KBD_META, - 'l', KBD_ALTGR, - 'h', KBD_SHIFT, - 't', KBD_CTL + { 'm', KBD_META }, + { 'l', KBD_ALTGR }, + { 'h', KBD_SHIFT }, + { 't', KBD_CTL } }; for(i = 0; i < 4; i++) @@ -668,6 +691,7 @@ int kbfd; /*---------------------------------------------------------------------------* * care for normal keys *---------------------------------------------------------------------------*/ +void set_char(keyflag, kbfd) char keyflag[]; int kbfd; @@ -683,11 +707,11 @@ int kbfd; char *addr; char ch; } standard[] = { - 0, 'D', - &entry.unshift[0], 'K', - &entry.shift[0], 'S', - &entry.ctrl[0], 'C', - &entry.altgr[0], 'A' + { 0, 'D' }, + { &entry.unshift[0], 'K' }, + { &entry.shift[0], 'S' }, + { &entry.ctrl[0], 'C' }, + { &entry.altgr[0], 'A' } }; for(i = 1; i < KBDMAXKEYS; i++) @@ -720,7 +744,7 @@ int kbfd; else { addr_str = standard[j].addr; - if(new_str = kgetstr(cap, &addr_str)) + if((new_str = kgetstr(cap, &addr_str))) { if(strlen(new_str) > KBDMAXOVLKEYSIZE) { diff --git a/sys/arch/i386/isa/pcvt/Util/keycap/keycap.c b/sys/arch/i386/isa/pcvt/Util/keycap/keycap.c index f70e987b0f6..07348507fe3 100644 --- a/sys/arch/i386/isa/pcvt/Util/keycap/keycap.c +++ b/sys/arch/i386/isa/pcvt/Util/keycap/keycap.c @@ -62,8 +62,11 @@ static char *id = * *---------------------------------------------------------------------------*/ -#include #include +#include +#include +#include +#include #include "keycap.h" @@ -73,7 +76,6 @@ static char *id = char *getenv(); -static FILE *pfp = NULL; /* keycap data base file pointer */ static char *tbuf; static int hopcount; /* detect infinite loops in keycap, init 0 */ @@ -91,7 +93,7 @@ char *id,*cstr; register char *c = cstr+n; if (strncmp(id,cstr,n)==0 && - (*c==':' || *c=='|' || *c=='=' || *c=='#') || *c=='@') + (*c==':' || *c=='|' || *c=='=' || *c=='#' || *c=='@')) return c; return 0; } @@ -100,14 +102,13 @@ char *id,*cstr; * Get an entry for keyboard name in buffer bp from the keycap file. * Parse is very rudimentary, we just notice escaped newlines. *---------------------------------------------------------------------------*/ -kgetent(bp, name) +int kgetent(bp, name) char *bp, *name; { register char *cp; register int c; register int i = 0, cnt = 0; char ibuf[KEYCAP_BUFSIZ]; - char *cp2; int tf; tbuf = bp; diff --git a/sys/arch/i386/isa/pcvt/Util/loadfont/loadfont.c b/sys/arch/i386/isa/pcvt/Util/loadfont/loadfont.c index 3d66fd8e932..3c10e5c8003 100644 --- a/sys/arch/i386/isa/pcvt/Util/loadfont/loadfont.c +++ b/sys/arch/i386/isa/pcvt/Util/loadfont/loadfont.c @@ -47,9 +47,12 @@ static char *id = * *---------------------------------------------------------------------------*/ -#include -#include #include +#include +#include +#include +#include +#include #include #include #include @@ -69,6 +72,7 @@ static void printvgafontattr(int charset); static void printheader(void); static void usage(void); +int main(int argc, char **argv) { extern int optind; @@ -85,11 +89,11 @@ main(int argc, char **argv) int scan_lines = -1; int c; int chr_set = -1; - char *filename; + char *filename = NULL; int fflag = -1; int info = -1; int dflag = 0; - char *device; + char *device = NULL; while( (c = getopt(argc, argv, "c:d:f:is:")) != EOF) { @@ -238,8 +242,8 @@ main(int argc, char **argv) if(chr_height * 256 != sbp->st_size || chr_height < 8 || chr_height > 20) { fprintf(stderr, - "File is no valid font file, size = %d.\n", - sbp->st_size); + "File is no valid font file, size = %ld.\n", + (long)sbp->st_size); exit(1); } @@ -256,9 +260,9 @@ main(int argc, char **argv) sbp->st_size) { fprintf(stderr, - "error reading file %s, size = %d, read = %d, " + "error reading file %s, size = %ld, read = %d, " "errno %d\n", - argv[1], sbp->st_size, ret, errno); + argv[1], (long)sbp->st_size, ret, errno); exit(1); } diff --git a/sys/arch/i386/isa/pcvt/Util/scon/scon.c b/sys/arch/i386/isa/pcvt/Util/scon/scon.c index 0c512ab4cd3..53776168b54 100644 --- a/sys/arch/i386/isa/pcvt/Util/scon/scon.c +++ b/sys/arch/i386/isa/pcvt/Util/scon/scon.c @@ -56,8 +56,11 @@ static char *id = * *---------------------------------------------------------------------------*/ -#include #include +#include +#include +#include +#include #include #define DEFAULTFD 0 @@ -185,8 +188,12 @@ static struct colname { static void parsepopt(char *arg, unsigned *idx, unsigned *r, unsigned *g, unsigned *b); static void printpalette(int fd); +void printinfo(int fd); +void printadaptor(int fd); +void printmonitor(int fd); +void usage(); -main(argc,argv) +int main(argc,argv) int argc; char *argv[]; { @@ -527,7 +534,7 @@ success: exit(0); } -usage() +void usage() { fprintf(stderr,"\nscon - screen control utility for the pcvt video driver\n"); fprintf(stderr,"usage: scon -a -l -m -v -c [n] -d [dev] -f [on|off] -V -H -s [n]\n"); @@ -553,7 +560,7 @@ usage() exit(1); } -printadaptor(fd) +void printadaptor(fd) int fd; { if(ioctl(fd, VGAGETSCREEN, &screeninfo) == -1) @@ -586,7 +593,7 @@ int fd; } } -printmonitor(fd) +void printmonitor(fd) int fd; { if(ioctl(fd, VGAGETSCREEN, &screeninfo) == -1) @@ -669,7 +676,7 @@ char *vga_family(int number) return(vga_tab[number]); } -printinfo(fd) +void printinfo(fd) int fd; { if(ioctl(fd, VGAGETSCREEN, &screeninfo) == -1) @@ -823,7 +830,7 @@ static void printpalette(int fd) const char *cp; printf("%5d %5d %5d %5d", idx, palette[idx].r, palette[idx].g, palette[idx].b); - if(cp = findname(idx)) + if((cp = findname(idx))) printf(" %s\n", cp); else putchar('\n'); diff --git a/sys/arch/i386/isa/pcvt/Util/userkeys/vt220keys.c b/sys/arch/i386/isa/pcvt/Util/userkeys/vt220keys.c index dfde51a2691..bca5a787ae8 100644 --- a/sys/arch/i386/isa/pcvt/Util/userkeys/vt220keys.c +++ b/sys/arch/i386/isa/pcvt/Util/userkeys/vt220keys.c @@ -26,8 +26,10 @@ */ -#include #include +#include +#include +#include /* * The default toupper() macro is stupid, will toupper anything @@ -46,30 +48,36 @@ struct keynames { char *name ; char *string ; } keys[] = { - "F6", "17", - "F7", "18", - "F8", "19", - "F9", "20", - "F10", "21", - "F11", "23", - "ESC", "23", - "F12", "24", - "BS", "24", - "F13", "25", - "LF", "25", - "F14", "26", - "HELP", "28", - "DO", "29", - "F17", "31", - "F18", "32", - "F19", "33", - "F20", "34", - NULL, NULL + { "F6", "17" }, + { "F7", "18" }, + { "F8", "19" }, + { "F9", "20" }, + { "F10", "21" }, + { "F11", "23" }, + { "ESC", "23" }, + { "F12", "24" }, + { "BS", "24" }, + { "F13", "25" }, + { "LF", "25" }, + { "F14", "26" }, + { "HELP", "28" }, + { "DO", "29" }, + { "F17", "31" }, + { "F18", "32" }, + { "F19", "33" }, + { "F20", "34" }, + { NULL, NULL } }; char prog[BUFSIZ]; -main(argc,argv) +void usage __P((void)); +void clearkeys __P((void)); +void getinit __P((void)); +void dokey __P((char *, char *)); +void lockkeys __P((void)); + +int main(argc,argv) int argc; char *argv[]; { @@ -142,12 +150,12 @@ main(argc,argv) * for each pair, who cares, really. */ -dokey(nm,val) char *nm, *val; +void dokey(nm,val) char *nm, *val; { register char *scr; register struct keynames *kp; - for(scr = nm; *scr = toupper(*scr); scr++) + for(scr = nm; (*scr = toupper(*scr)); scr++) ; for(kp = keys; kp->name != NULL; kp++) if(strcmp(nm,kp->name) == 0) { @@ -163,7 +171,7 @@ dokey(nm,val) char *nm, *val; /****************************************************************************/ -clearkeys() +void clearkeys() { printf("%cP0;1|%c\\",ESC,ESC); fflush(stdout); @@ -171,7 +179,7 @@ clearkeys() /****************************************************************************/ -lockkeys() +void lockkeys() { printf("%cP1;0|%c\\",ESC,ESC); fflush(stdout); @@ -179,7 +187,7 @@ lockkeys() /****************************************************************************/ -usage() +void usage() { int i; @@ -219,7 +227,7 @@ usage() #include #include -getinit() +void getinit() { char *home; /* user's home directory */ char path[BUFSIZ]; /* full path name of init file */