From 13edc2540c032f37e32a50af24131ca681953486 Mon Sep 17 00:00:00 2001 From: Maxim Sobolev Date: Tue, 29 May 2001 13:59:02 +0000 Subject: [PATCH] - Syncronizes command line syntax warnings with manpage (bin/27010); - silence gcc(1) warnings (sobomax). PR: 27010 Submitted by: Alex Kapranoff , sobomax MFC after: 10 days --- usr.sbin/kbdcontrol/kbdcontrol.c | 21 ++++++++++++--------- usr.sbin/kbdcontrol/lex.h | 2 ++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c index 122bc85cc97f..af47958c1eb0 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.c +++ b/usr.sbin/kbdcontrol/kbdcontrol.c @@ -109,7 +109,9 @@ int number; char letter; int token; -static void usage __P((void)); +int get_accent_definition_line __P((accentmap_t *)); +int get_key_definition_line __P((keymap_t *)); +void usage __P((void)); char * nextarg(int ac, char **av, int *indp, int oc) @@ -130,11 +132,12 @@ mkfullname(const char *s1, const char *s2, const char *s3) int f; f = strlen(s1) + strlen(s2) + strlen(s3) + 1; - if (f > bufl) + if (f > bufl) { if (buf) buf = (char *)realloc(buf, f); else buf = (char *)malloc(f); + } if (!buf) { bufl = 0; return(NULL); @@ -235,7 +238,7 @@ get_entry() } } -int +static int get_definition_line(FILE *fd, keymap_t *keymap, accentmap_t *accentmap) { int c; @@ -902,7 +905,7 @@ set_bell_values(char *opt) pitch = strtol(opt, &v1, 0); if ((pitch < 0) || (*opt == '\0') || (*v1 != '\0')) { badopt: - warnx("argument to -b must be DURATION.PITCH"); + warnx("argument to -b must be duration.pitch or [quiet.]visual|normal|off"); return; } if (pitch != 0) @@ -944,7 +947,7 @@ set_keyrates(char *opt) repeat = strtol(opt, &v1, 0); if ((repeat < 0) || (*opt == '\0') || (*v1 != '\0')) { badopt: - warnx("argument to -r must be delay.repeat"); + warnx("argument to -r must be delay.repeat or slow|normal|fast"); return; } for (n = 0; n < ndelays - 1; n++) @@ -996,7 +999,7 @@ show_kbd_info(void) } printf("kbd%d:\n", info.kb_index); printf(" %.*s%d, type:%s (%d)\n", - sizeof(info.kb_name), info.kb_name, info.kb_unit, + (int)sizeof(info.kb_name), info.kb_name, info.kb_unit, get_kbd_type_name(info.kb_type), info.kb_type); } @@ -1027,7 +1030,7 @@ set_keyboard(char *device) #if 1 printf("kbd%d\n", info.kb_index); printf(" %.*s%d, type:%s (%d)\n", - sizeof(info.kb_name), info.kb_name, info.kb_unit, + (int)sizeof(info.kb_name), info.kb_name, info.kb_unit, get_kbd_type_name(info.kb_type), info.kb_type); #endif @@ -1052,7 +1055,7 @@ release_keyboard(void) #if 1 printf("kbd%d\n", info.kb_index); printf(" %.*s%d, type:%s (%d)\n", - sizeof(info.kb_name), info.kb_name, info.kb_unit, + (int)sizeof(info.kb_name), info.kb_name, info.kb_unit, get_kbd_type_name(info.kb_type), info.kb_type); #endif if (ioctl(0, CONS_RELKBD, 0) == -1) @@ -1060,7 +1063,7 @@ release_keyboard(void) } -static void +void usage() { fprintf(stderr, "%s\n%s\n%s\n", diff --git a/usr.sbin/kbdcontrol/lex.h b/usr.sbin/kbdcontrol/lex.h index 9dc1fdfb200c..3ceb1f1f847a 100644 --- a/usr.sbin/kbdcontrol/lex.h +++ b/usr.sbin/kbdcontrol/lex.h @@ -68,3 +68,5 @@ extern int number; extern char letter; extern FILE *yyin; + +extern int yylex __P((void));