From c3e2d898b4dda12a28e2356ac727df5bde5748fd Mon Sep 17 00:00:00 2001 From: christos Date: Fri, 10 Jan 2003 20:00:50 +0000 Subject: [PATCH] produce lint free code. --- usr.bin/menuc/mdb.c | 3 ++- usr.bin/menuc/menu_sys.def | 23 ++++++++++++----------- usr.bin/msgc/msg_sys.def | 14 +++++++------- usr.bin/msgc/msgdb.c | 9 +++++---- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/usr.bin/menuc/mdb.c b/usr.bin/menuc/mdb.c index 3b365d28dbb8..3b4599e435f6 100644 --- a/usr.bin/menuc/mdb.c +++ b/usr.bin/menuc/mdb.c @@ -1,4 +1,4 @@ -/* $NetBSD: mdb.c,v 1.23 2002/03/07 20:43:29 tv Exp $ */ +/* $NetBSD: mdb.c,v 1.24 2003/01/10 20:00:50 christos Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -279,6 +279,7 @@ write_menu_file (char *initcode) if (strlen(toptn->optact.code)) { (void) fprintf (out_file, "int opt_act_%d_%d(menudesc *m);\n" + "/*ARGSUSED*/\n" "int opt_act_%d_%d(menudesc *m)\n" "{\t%s\n\treturn %s;\n}\n\n", i, j, i, j, toptn->optact.code, diff --git a/usr.bin/menuc/menu_sys.def b/usr.bin/menuc/menu_sys.def index 93ed1bb16436..4d67c8d10905 100644 --- a/usr.bin/menuc/menu_sys.def +++ b/usr.bin/menuc/menu_sys.def @@ -1,4 +1,4 @@ -/* $NetBSD: menu_sys.def,v 1.29 2002/04/04 14:11:23 blymn Exp $ */ +/* $NetBSD: menu_sys.def,v 1.30 2003/01/10 20:00:50 christos Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -308,6 +308,7 @@ post_menu (struct menudesc *m) } static void +/*ARGSUSED*/ process_help (struct menudesc *m, int num) { char *help = m->helpstr; @@ -392,7 +393,7 @@ process_req (struct menudesc *m, int num, int req) { int ch; int hasexit = (m->mopt & MC_NOEXITOPT ? 0 : 1 ); - int refresh = 0; + int refr = 0; int scroll_sel = 0; if (req == REQ_EXECUTE) @@ -402,7 +403,7 @@ process_req (struct menudesc *m, int num, int req) if (m->cursel < m->numopts + hasexit - 1) { m->cursel++; scroll_sel = 1; - refresh = 1; + refr = 1; if (m->mopt & MC_SCROLL && m->cursel >= m->topline + m->h -1 ) m->topline += 1; @@ -413,7 +414,7 @@ process_req (struct menudesc *m, int num, int req) if (m->cursel > 0) { m->cursel--; scroll_sel = 1; - refresh = 1; + refr = 1; if (m->cursel < m->topline ) m->topline -= 1; } else @@ -424,11 +425,11 @@ process_req (struct menudesc *m, int num, int req) wrefresh(stdscr); if (m->post_act) (*m->post_act)(); - refresh = 1; + refr = 1; } else if (req == REQ_HELP) { process_help (m, num); - refresh = 1; + refr = 1; } else if (req == REQ_SCROLLUP) { if (!(m->mopt & MC_SCROLL)) @@ -439,7 +440,7 @@ process_req (struct menudesc *m, int num, int req) m->topline = MAX(0,m->topline-m->h+1); m->cursel = MAX(0, m->cursel-m->h+1); wclear (m->mw); - refresh = 1; + refr = 1; } } else if (req == REQ_SCROLLDOWN) { @@ -452,7 +453,7 @@ process_req (struct menudesc *m, int num, int req) m->numopts+hasexit-m->h+1); m->cursel = MIN(m->numopts-1, m->cursel+m->h-1); wclear (m->mw); - refresh = 1; + refr = 1; } } else { @@ -460,7 +461,7 @@ process_req (struct menudesc *m, int num, int req) if (ch == 'x' && hasexit) { m->cursel = m->numopts; scroll_sel = 1; - refresh = 1; + refr = 1; } else if (!(m->mopt & MC_NOSHORTCUT)) { if (ch > 'z') @@ -475,7 +476,7 @@ process_req (struct menudesc *m, int num, int req) else { m->cursel = ch; scroll_sel = 1; - refresh = 1; + refr = 1; } } else mbeep(); @@ -489,7 +490,7 @@ process_req (struct menudesc *m, int num, int req) m->topline = MAX(0,m->topline-m->h+1); } - if (refresh) { + if (refr) { post_menu (m); wrefresh (m->mw); } diff --git a/usr.bin/msgc/msg_sys.def b/usr.bin/msgc/msg_sys.def index 25a68a10b31e..153dec5738b2 100644 --- a/usr.bin/msgc/msg_sys.def +++ b/usr.bin/msgc/msg_sys.def @@ -1,4 +1,4 @@ -/* $NetBSD: msg_sys.def,v 1.17 1999/07/04 22:55:48 cgd Exp $ */ +/* $NetBSD: msg_sys.def,v 1.18 2003/01/10 20:01:12 christos Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -46,7 +46,7 @@ static int last_o_was_punct, last_o_was_space; static void _msg_beep(void); static int _msg_vprintf(int auto_fill, const char *fmt, va_list ap); static void _msg_vprompt(const char *msg, int do_echo, const char *def, - char *val, int max_chars, va_list ap); + char *val, size_t max_chars, va_list ap); /* Routines */ @@ -78,7 +78,7 @@ int msg_window(WINDOW *window) const char *msg_string (msg msg_no) { - return msg_list[(long)msg_no]; + return msg_list[(size_t)(intptr_t)msg_no]; } void msg_clear(void) @@ -248,7 +248,7 @@ void msg_display_add(msg msg_no, ...) static void _msg_vprompt(const char *msg, int do_echo, const char *def, char *val, - int max_chars, va_list ap) + size_t max_chars, va_list ap) { int ch; int count = 0; @@ -336,7 +336,7 @@ _msg_vprompt(const char *msg, int do_echo, const char *def, char *val, } void -msg_prompt(msg msg_no, const char *def, char *val, int max_chars, ...) +msg_prompt(msg msg_no, const char *def, char *val, size_t max_chars, ...) { va_list ap; @@ -348,7 +348,7 @@ msg_prompt(msg msg_no, const char *def, char *val, int max_chars, ...) } void -msg_prompt_add(msg msg_no, const char *def, char *val, int max_chars, ...) +msg_prompt_add(msg msg_no, const char *def, char *val, size_t max_chars, ...) { va_list ap; @@ -358,7 +358,7 @@ msg_prompt_add(msg msg_no, const char *def, char *val, int max_chars, ...) } void -msg_prompt_noecho(msg msg_no, const char *def, char *val, int max_chars, ...) +msg_prompt_noecho(msg msg_no, const char *def, char *val, size_t max_chars, ...) { va_list ap; diff --git a/usr.bin/msgc/msgdb.c b/usr.bin/msgc/msgdb.c index 8da74f25b750..1bc692d00b96 100644 --- a/usr.bin/msgc/msgdb.c +++ b/usr.bin/msgc/msgdb.c @@ -1,4 +1,4 @@ -/* $NetBSD: msgdb.c,v 1.12 2001/10/15 22:11:12 bjh21 Exp $ */ +/* $NetBSD: msgdb.c,v 1.13 2003/01/10 20:01:12 christos Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -140,6 +140,7 @@ write_msg_file () "#include \n" "#include \n" "#include \n" + "#include \n" "#include \n" "\n" "typedef const char *msg;\n" @@ -153,11 +154,11 @@ write_msg_file () "void msg_display(msg msg_no,...);\n" "void msg_display_add(msg msg_no,...);\n" "void msg_prompt (msg msg_no, const char *def," - " char *val, int max_chars, ...);\n" + " char *val, size_t max_chars, ...);\n" "void msg_prompt_add (msg msg_no, const char *def," - " char *val, int max_chars, ...);\n" + " char *val, size_t max_chars, ...);\n" "void msg_prompt_noecho (msg msg_no, const char *def," - " char *val, int max_chars, ...);\n" + " char *val, size_t max_chars, ...);\n" "void msg_table_add(msg msg_no,...);\n" "\n" "/* Message names */\n"