summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2002-07-11 21:12:18 +0000
committeralfred <alfred@FreeBSD.org>2002-07-11 21:12:18 +0000
commit39c57be6b9e222e42af27ac25ff9866c368c8142 (patch)
tree8686b52d85a656767bdf4f25145439d2b10c2032
parenteea24f3d3e2978a018cb6a89df150975e4f09010 (diff)
downloadFreeBSD-src-39c57be6b9e222e42af27ac25ff9866c368c8142.zip
FreeBSD-src-39c57be6b9e222e42af27ac25ff9866c368c8142.tar.gz
WARNS?=4 cleanup.
-rw-r--r--usr.sbin/kbdcontrol/Makefile2
-rw-r--r--usr.sbin/kbdcontrol/kbdcontrol.c48
-rw-r--r--usr.sbin/kbdcontrol/lex.l1
3 files changed, 34 insertions, 17 deletions
diff --git a/usr.sbin/kbdcontrol/Makefile b/usr.sbin/kbdcontrol/Makefile
index ad6540a..e7088a7 100644
--- a/usr.sbin/kbdcontrol/Makefile
+++ b/usr.sbin/kbdcontrol/Makefile
@@ -10,4 +10,6 @@ CFLAGS+= -I${.CURDIR}
DPADD= ${LIBL}
LDADD= -ll
+WARNS?= 4
+
.include <bsd.prog.mk>
diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c
index 8a2f46f..f44ea11 100644
--- a/usr.sbin/kbdcontrol/kbdcontrol.c
+++ b/usr.sbin/kbdcontrol/kbdcontrol.c
@@ -115,9 +115,29 @@ int number;
char letter;
int token;
+void dump_accent_definition(char *name, accentmap_t *accentmap);
+void dump_entry(int value);
+void dump_key_definition(char *name, keymap_t *keymap);
int get_accent_definition_line(accentmap_t *);
+int get_entry(void);
int get_key_definition_line(keymap_t *);
-void usage(void);
+void load_keymap(char *opt, int dumponly);
+void load_default_functionkeys(void);
+char * nextarg(int ac, char **av, int *indp, int oc);
+char * mkfullname(const char *s1, const char *s2, const char *s3);
+void print_accent_definition_line(FILE *fp, int accent,
+ struct acc_t *key);
+void print_entry(FILE *fp, int value);
+void print_key_definition_line(FILE *fp, int scancode,
+ struct keyent_t *key);
+void print_keymap(void);
+void release_keyboard(void);
+void set_bell_values(char *opt);
+void set_functionkey(char *keynumstr, char *string);
+void set_keyboard(char *device);
+void set_keyrates(char *opt);
+void show_kbd_info(void);
+void usage(void) __dead2;
char *
nextarg(int ac, char **av, int *indp, int oc)
@@ -126,7 +146,6 @@ nextarg(int ac, char **av, int *indp, int oc)
return(av[(*indp)++]);
warnx("option requires two arguments -- %c", oc);
usage();
- return("");
}
@@ -158,7 +177,7 @@ mkfullname(const char *s1, const char *s2, const char *s3)
int
-get_entry()
+get_entry(void)
{
switch ((token = yylex())) {
case TNOP:
@@ -489,7 +508,6 @@ print_entry(FILE *fp, int value)
}
}
-
void
print_key_definition_line(FILE *fp, int scancode, struct keyent_t *key)
{
@@ -765,8 +783,9 @@ load_keymap(char *opt, int dumponly)
FILE *fd;
int i, j;
char *name, *cp;
- char *prefix[] = {"", "", KEYMAP_PATH, NULL};
- char *postfix[] = {"", ".kbd", NULL};
+ char blank[] = "", keymap_path[] = KEYMAP_PATH, dotkbd[] = ".kbd";
+ char *prefix[] = {blank, blank, keymap_path, NULL};
+ char *postfix[] = {blank, dotkbd, NULL};
cp = getenv("KEYMAP_PATH");
if (cp != NULL)
@@ -816,7 +835,7 @@ load_keymap(char *opt, int dumponly)
}
void
-print_keymap()
+print_keymap(void)
{
keymap_t keymap;
accentmap_t accentmap;
@@ -841,9 +860,8 @@ print_keymap()
}
-
void
-load_default_functionkeys()
+load_default_functionkeys(void)
{
fkeyarg_t fkey;
int i;
@@ -883,7 +901,6 @@ set_functionkey(char *keynumstr, char *string)
warn("setting function key");
}
-
void
set_bell_values(char *opt)
{
@@ -924,7 +941,6 @@ badopt:
fprintf(stderr, "[=%d;%dB", pitch, duration);
}
-
void
set_keyrates(char *opt)
{
@@ -974,18 +990,18 @@ badopt:
}
}
-static char
-*get_kbd_type_name(int type)
+static const char *
+get_kbd_type_name(int type)
{
static struct {
int type;
- char *name;
+ const char *name;
} name_table[] = {
{ KB_84, "AT 84" },
{ KB_101, "AT 101/102" },
{ KB_OTHER, "generic" },
};
- int i;
+ unsigned int i;
for (i = 0; i < sizeof(name_table)/sizeof(name_table[0]); ++i) {
if (type == name_table[i].type)
@@ -1009,7 +1025,6 @@ show_kbd_info(void)
get_kbd_type_name(info.kb_type), info.kb_type);
}
-
void
set_keyboard(char *device)
{
@@ -1044,7 +1059,6 @@ set_keyboard(char *device)
warn("unable to set keyboard");
}
-
void
release_keyboard(void)
{
diff --git a/usr.sbin/kbdcontrol/lex.l b/usr.sbin/kbdcontrol/lex.l
index 67223c1..7d9fd53 100644
--- a/usr.sbin/kbdcontrol/lex.l
+++ b/usr.sbin/kbdcontrol/lex.l
@@ -31,6 +31,7 @@
%{
#include "lex.h"
+#define YY_NO_UNPUT
%}
OpenPOWER on IntegriCloud