summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1996-12-21 22:23:53 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1996-12-21 22:23:53 +0000
commitc60e06beeb20521a15bacc5c672aa1b865b06a67 (patch)
treef2cc3a0e68a020f5e59132403d4a16547626359f /sys/arch/i386
parentf2d04b4c3d006dcc05c58dab6068fed44f01098a (diff)
-Wall madness.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/isa/pcvt/Util/cursor/cursor.c12
-rw-r--r--sys/arch/i386/isa/pcvt/Util/fed/misc.c4
-rw-r--r--sys/arch/i386/isa/pcvt/Util/fontedit/fontedit.c26
-rw-r--r--sys/arch/i386/isa/pcvt/Util/ispcvt/ispcvt.c16
-rw-r--r--sys/arch/i386/isa/pcvt/Util/kcon/kcon.c58
-rw-r--r--sys/arch/i386/isa/pcvt/Util/keycap/keycap.c11
-rw-r--r--sys/arch/i386/isa/pcvt/Util/loadfont/loadfont.c20
-rw-r--r--sys/arch/i386/isa/pcvt/Util/scon/scon.c21
-rw-r--r--sys/arch/i386/isa/pcvt/Util/userkeys/vt220keys.c62
9 files changed, 158 insertions, 72 deletions
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 <stdio.h>
#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <sys/stat.h>
#include <machine/pcvt_ioctl.h>
#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 <line> 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 <sys/ioctl.h>
#endif /* __NetBSD__ || __OpenBSD__ || __FreeBSD__ */
#include <signal.h>
+#include <string.h>
+#include <unistd.h>
#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 <stdio.h>
#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <machine/pcvt_ioctl.h>
#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 <fcntl.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <machine/pcvt_ioctl.h>
@@ -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 <stdio.h>
#include <ctype.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
#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 <stdio.h>
-#include <fcntl.h>
#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <machine/pcvt_ioctl.h>
@@ -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 <stdio.h>
#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <machine/pcvt_ioctl.h>
#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 <stdio.h>
#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
/*
* 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 <sys/types.h>
#include <sys/stat.h>
-getinit()
+void getinit()
{
char *home; /* user's home directory */
char path[BUFSIZ]; /* full path name of init file */