Kill __P(), ANSIfy, remove main() prototype; WARNS=2
This commit is contained in:
parent
d4a0de51f8
commit
844f4c525d
|
@ -1,5 +1,6 @@
|
|||
# $NetBSD: Makefile,v 1.10 2003/10/21 10:01:20 lukem Exp $
|
||||
# $NetBSD: Makefile,v 1.11 2005/01/19 20:37:52 xtraeme Exp $
|
||||
|
||||
WARNS= 2
|
||||
PROG= wsconsctl
|
||||
SRCS= display.c keyboard.c keysym.c map_parse.y map_scan.l \
|
||||
mouse.c util.c wsconsctl.c
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: display.c,v 1.8 2004/07/30 15:22:42 jmmv Exp $ */
|
||||
/* $NetBSD: display.c,v 1.9 2005/01/19 20:37:52 xtraeme Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
|
||||
|
@ -73,8 +73,7 @@ int display_field_tab_len = sizeof(display_field_tab)/
|
|||
sizeof(display_field_tab[0]);
|
||||
|
||||
void
|
||||
display_get_values(fd)
|
||||
int fd;
|
||||
display_get_values(int fd)
|
||||
{
|
||||
if (field_by_value(&dpytype)->flags & FLG_GET)
|
||||
if (ioctl(fd, WSDISPLAYIO_GTYPE, &dpytype) < 0)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: keyboard.c,v 1.6 2004/07/30 15:22:42 jmmv Exp $ */
|
||||
/* $NetBSD: keyboard.c,v 1.7 2005/01/19 20:37:52 xtraeme Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
|
||||
|
@ -82,8 +82,7 @@ int keyboard_field_tab_len = sizeof(keyboard_field_tab)/
|
|||
sizeof(keyboard_field_tab[0]);
|
||||
|
||||
void
|
||||
keyboard_get_values(fd)
|
||||
int fd;
|
||||
keyboard_get_values(int fd)
|
||||
{
|
||||
if (field_by_value(&kbtype)->flags & FLG_GET)
|
||||
if (ioctl(fd, WSKBDIO_GTYPE, &kbtype) < 0)
|
||||
|
@ -163,8 +162,7 @@ keyboard_get_values(fd)
|
|||
}
|
||||
|
||||
void
|
||||
keyboard_put_values(fd)
|
||||
int fd;
|
||||
keyboard_put_values(int fd)
|
||||
{
|
||||
bell.which = 0;
|
||||
if (field_by_value(&bell.pitch)->flags & FLG_SET)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: keysym.c,v 1.4 2000/07/03 03:38:02 matt Exp $ */
|
||||
/* $NetBSD: keysym.c,v 1.5 2005/01/19 20:37:52 xtraeme Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -87,47 +87,39 @@ static const u_char latin1_to_upper[256] = {
|
|||
0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* f */
|
||||
};
|
||||
|
||||
static int qcmp_name __P((const void *, const void *));
|
||||
static int qcmp_ksym __P((const void *, const void *));
|
||||
static int bcmp_name __P((const void *, const void *));
|
||||
static int bcmp_ksym __P((const void *, const void *));
|
||||
static int qcmp_name(const void *, const void *);
|
||||
static int qcmp_ksym(const void *, const void *);
|
||||
static int bcmp_name(const void *, const void *);
|
||||
static int bcmp_ksym(const void *, const void *);
|
||||
|
||||
static void sort_ksym_tab __P((void));
|
||||
static void sort_ksym_tab(void);
|
||||
|
||||
static int
|
||||
qcmp_name(a, b)
|
||||
const void *a;
|
||||
const void *b;
|
||||
qcmp_name(const void *a, const void *b)
|
||||
{
|
||||
return(strcmp(((struct ksym *) a)->name, ((struct ksym *) b)->name));
|
||||
}
|
||||
|
||||
static int
|
||||
qcmp_ksym(a, b)
|
||||
const void *a;
|
||||
const void *b;
|
||||
qcmp_ksym(const void *a, const void *b)
|
||||
{
|
||||
return(((struct ksym *) b)->value - ((struct ksym *) a)->value);
|
||||
}
|
||||
|
||||
static int
|
||||
bcmp_name(a, b)
|
||||
const void *a;
|
||||
const void *b;
|
||||
bcmp_name(const void *a, const void *b)
|
||||
{
|
||||
return(strcmp((char *) a, ((struct ksym *) b)->name));
|
||||
}
|
||||
|
||||
static int
|
||||
bcmp_ksym(a, b)
|
||||
const void *a;
|
||||
const void *b;
|
||||
bcmp_ksym(const void *a, const void *b)
|
||||
{
|
||||
return(((struct ksym *) b)->value - *((int *) a));
|
||||
}
|
||||
|
||||
static void
|
||||
sort_ksym_tab()
|
||||
sort_ksym_tab(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -141,8 +133,7 @@ sort_ksym_tab()
|
|||
}
|
||||
|
||||
char *
|
||||
ksym2name(k)
|
||||
int k;
|
||||
ksym2name(int k)
|
||||
{
|
||||
static char tmp[20];
|
||||
struct ksym *r;
|
||||
|
@ -162,8 +153,7 @@ ksym2name(k)
|
|||
}
|
||||
|
||||
int
|
||||
name2ksym(n)
|
||||
char *n;
|
||||
name2ksym(char *n)
|
||||
{
|
||||
int res;
|
||||
struct ksym *r;
|
||||
|
@ -183,8 +173,7 @@ name2ksym(n)
|
|||
}
|
||||
|
||||
keysym_t
|
||||
ksym_upcase(ksym)
|
||||
keysym_t ksym;
|
||||
ksym_upcase(keysym_t ksym)
|
||||
{
|
||||
if (ksym >= KS_f1 && ksym <= KS_f20)
|
||||
return(KS_F1 - KS_f1 + ksym);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: map_parse.y,v 1.3 2004/06/27 02:09:47 itohy Exp $ */
|
||||
/* $NetBSD: map_parse.y,v 1.4 2005/01/19 20:37:52 xtraeme Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -66,11 +66,10 @@ static struct wscons_keymap mapdata[KS_NUMKEYCODES];
|
|||
struct wskbd_map_data newkbmap; /* used in util.c */
|
||||
static struct wscons_keymap *cur_mp;
|
||||
|
||||
static int ksym_lookup __P((keysym_t));
|
||||
static int ksym_lookup(keysym_t);
|
||||
|
||||
static int
|
||||
ksym_lookup(ksym)
|
||||
keysym_t ksym;
|
||||
ksym_lookup(keysym_t ksym)
|
||||
{
|
||||
int i;
|
||||
struct wscons_keymap *mp;
|
||||
|
@ -198,8 +197,7 @@ keysym_var : T_KEYSYM_VAR = {
|
|||
%%
|
||||
|
||||
void
|
||||
yyerror(msg)
|
||||
char *msg;
|
||||
yyerror(char *msg)
|
||||
{
|
||||
errx(1, "parse: %s", msg);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: map_scan.l,v 1.1 1998/12/28 14:01:17 hannken Exp $ */
|
||||
/* $NetBSD: map_scan.l,v 1.2 2005/01/19 20:37:52 xtraeme Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -47,8 +47,7 @@
|
|||
#define yywrap() 1
|
||||
|
||||
void
|
||||
map_scan_setinput(str)
|
||||
char *str;
|
||||
map_scan_setinput(char *str)
|
||||
{
|
||||
yy_scan_string(str);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: mouse.c,v 1.3 1999/11/15 13:47:30 ad Exp $ */
|
||||
/* $NetBSD: mouse.c,v 1.4 2005/01/19 20:37:52 xtraeme Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -56,8 +56,7 @@ int mouse_field_tab_len = sizeof(mouse_field_tab)/
|
|||
sizeof(mouse_field_tab[0]);
|
||||
|
||||
void
|
||||
mouse_get_values(fd)
|
||||
int fd;
|
||||
mouse_get_values(int fd)
|
||||
{
|
||||
if (field_by_value(&mstype)->flags & FLG_GET)
|
||||
if (ioctl(fd, WSMOUSEIO_GTYPE, &mstype) < 0)
|
||||
|
@ -65,8 +64,7 @@ mouse_get_values(fd)
|
|||
}
|
||||
|
||||
void
|
||||
mouse_put_values(fd)
|
||||
int fd;
|
||||
mouse_put_values(int fd)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: util.c,v 1.20 2004/07/30 11:08:03 jmmv Exp $ */
|
||||
/* $NetBSD: util.c,v 1.21 2005/01/19 20:37:52 xtraeme Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -164,22 +164,19 @@ static struct nameint attr_tab[] = {
|
|||
static struct field *field_tab;
|
||||
static int field_tab_len;
|
||||
|
||||
static char *int2name __P((int, int, struct nameint *, int));
|
||||
static int name2int __P((char *, struct nameint *, int));
|
||||
static void print_kmap __P((struct wskbd_map_data *));
|
||||
static char *int2name(int, int, struct nameint *, int);
|
||||
static int name2int(char *, struct nameint *, int);
|
||||
static void print_kmap(struct wskbd_map_data *);
|
||||
|
||||
void
|
||||
field_setup(ftab, len)
|
||||
struct field *ftab;
|
||||
int len;
|
||||
field_setup(struct field *ftab, int len)
|
||||
{
|
||||
field_tab = ftab;
|
||||
field_tab_len = len;
|
||||
}
|
||||
|
||||
struct field *
|
||||
field_by_name(name)
|
||||
char *name;
|
||||
field_by_name(char *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -191,8 +188,7 @@ field_by_name(name)
|
|||
}
|
||||
|
||||
struct field *
|
||||
field_by_value(addr)
|
||||
void *addr;
|
||||
field_by_value(void *addr)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -204,8 +200,7 @@ field_by_value(addr)
|
|||
}
|
||||
|
||||
void
|
||||
field_disable_by_value(addr)
|
||||
void *addr;
|
||||
field_disable_by_value(void *addr)
|
||||
{
|
||||
struct field *f;
|
||||
|
||||
|
@ -214,11 +209,7 @@ field_disable_by_value(addr)
|
|||
}
|
||||
|
||||
static char *
|
||||
int2name(val, uflag, tab, len)
|
||||
int val;
|
||||
int uflag;
|
||||
struct nameint *tab;
|
||||
int len;
|
||||
int2name(int val, int uflag, struct nameint *tab, int len)
|
||||
{
|
||||
static char tmp[20];
|
||||
int i;
|
||||
|
@ -235,10 +226,7 @@ int2name(val, uflag, tab, len)
|
|||
}
|
||||
|
||||
static int
|
||||
name2int(val, tab, len)
|
||||
char *val;
|
||||
struct nameint *tab;
|
||||
int len;
|
||||
name2int(char *val, struct nameint *tab, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -249,9 +237,7 @@ name2int(val, tab, len)
|
|||
}
|
||||
|
||||
void
|
||||
pr_field(f, sep)
|
||||
struct field *f;
|
||||
char *sep;
|
||||
pr_field(struct field *f, char *sep)
|
||||
{
|
||||
char *p;
|
||||
u_int flags;
|
||||
|
@ -328,10 +314,7 @@ pr_field(f, sep)
|
|||
}
|
||||
|
||||
void
|
||||
rd_field(f, val, merge)
|
||||
struct field *f;
|
||||
char *val;
|
||||
int merge;
|
||||
rd_field(struct field *f, char *val, int merge)
|
||||
{
|
||||
int i;
|
||||
u_int u;
|
||||
|
@ -420,8 +403,7 @@ rd_field(f, val, merge)
|
|||
}
|
||||
|
||||
static void
|
||||
print_kmap(map)
|
||||
struct wskbd_map_data *map;
|
||||
print_kmap(struct wskbd_map_data *map)
|
||||
{
|
||||
int i;
|
||||
struct wscons_keymap *mp;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: wsconsctl.c,v 1.9 2004/07/30 15:22:42 jmmv Exp $ */
|
||||
/* $NetBSD: wsconsctl.c,v 1.10 2005/01/19 20:37:52 xtraeme Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
|
||||
|
@ -55,12 +55,10 @@ extern int keyboard_field_tab_len;
|
|||
extern int mouse_field_tab_len;
|
||||
extern int display_field_tab_len;
|
||||
|
||||
static void usage __P((char *));
|
||||
int main __P((int, char **));
|
||||
static void usage(char *);
|
||||
|
||||
static void
|
||||
usage(msg)
|
||||
char *msg;
|
||||
usage(char *msg)
|
||||
{
|
||||
const char *progname = getprogname();
|
||||
|
||||
|
@ -79,17 +77,15 @@ usage(msg)
|
|||
}
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int i, ch, fd;
|
||||
int aflag, dflag, kflag, mflag, wflag;
|
||||
char *file, *sep, *p;
|
||||
struct field *f, *field_tab;
|
||||
int do_merge, field_tab_len;
|
||||
void (*getval) __P((int));
|
||||
void (*putval) __P((int));
|
||||
void (*getval)(int);
|
||||
void (*putval)(int);
|
||||
|
||||
aflag = 0;
|
||||
dflag = 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: wsconsctl.h,v 1.6 2004/07/30 15:22:42 jmmv Exp $ */
|
||||
/* $NetBSD: wsconsctl.h,v 1.7 2005/01/19 20:37:53 xtraeme Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
|
||||
|
@ -79,24 +79,24 @@ struct field {
|
|||
int flags;
|
||||
};
|
||||
|
||||
void field_setup __P((struct field *, int));
|
||||
struct field *field_by_name __P((char *));
|
||||
struct field *field_by_value __P((void *));
|
||||
void field_disable_by_value __P((void *));
|
||||
void pr_field __P((struct field *, char *));
|
||||
void rd_field __P((struct field *, char *, int));
|
||||
int name2ksym __P((char *));
|
||||
char *ksym2name __P((int));
|
||||
keysym_t ksym_upcase __P((keysym_t));
|
||||
void keyboard_get_values __P((int));
|
||||
void keyboard_put_values __P((int));
|
||||
void mouse_get_values __P((int));
|
||||
void mouse_put_values __P((int));
|
||||
void display_get_values __P((int));
|
||||
void display_put_values __P((int));
|
||||
void field_setup(struct field *, int);
|
||||
struct field *field_by_name(char *);
|
||||
struct field *field_by_value(void *);
|
||||
void field_disable_by_value(void *);
|
||||
void pr_field(struct field *, char *);
|
||||
void rd_field(struct field *, char *, int);
|
||||
int name2ksym(char *);
|
||||
char *ksym2name(int);
|
||||
keysym_t ksym_upcase(keysym_t);
|
||||
void keyboard_get_values(int);
|
||||
void keyboard_put_values(int);
|
||||
void mouse_get_values(int);
|
||||
void mouse_put_values(int);
|
||||
void display_get_values(int);
|
||||
void display_put_values(int);
|
||||
#ifndef YYEMPTY
|
||||
int yyparse __P((void));
|
||||
int yyparse(void);
|
||||
#endif
|
||||
void yyerror __P((char *));
|
||||
int yylex __P((void));
|
||||
void map_scan_setinput __P((char *));
|
||||
void yyerror(char *);
|
||||
int yylex(void);
|
||||
void map_scan_setinput(char *);
|
||||
|
|
Loading…
Reference in New Issue