produce lint free code.

This commit is contained in:
christos 2003-01-10 20:00:50 +00:00
parent 2d7e213ded
commit c3e2d898b4
4 changed files with 26 additions and 23 deletions

View File

@ -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,

View File

@ -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);
}

View File

@ -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;

View File

@ -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 <string.h>\n"
"#include <ctype.h>\n"
"#include <stdarg.h>\n"
"#include <stdint.h>\n"
"#include <curses.h>\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"